Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark AbstractNode as abstract class #1117

Open
bitPogo opened this issue Nov 4, 2020 · 2 comments
Open

Mark AbstractNode as abstract class #1117

bitPogo opened this issue Nov 4, 2020 · 2 comments

Comments

@bitPogo
Copy link
Contributor

bitPogo commented Nov 4, 2020

According to the dec block in the types as well as in the code AbstractNode is a abstract BaseClass. For more semantical expression it should be marked as a abstract class in the type definition.

@bitPogo bitPogo changed the title Should AbstractNode marked as abstract class/interface Mark AbstractNode as abstract class Nov 4, 2020
@ggrossetie
Copy link
Member

Indeed, even though you cannot really extend AbstractNode or at least that's not the right way to do it since AbstractNode is a Ruby class. So if you want to extend AbstractNode you will need to create a new class with AbstractNode as a superclass using Opal.allocate_class (from Opal runtime):

https://github.com/opal/opal/blob/505fd5d7e899a6766472b302c079b4d383fd8216/opal/corelib/runtime.js#L452

@bitPogo
Copy link
Contributor Author

bitPogo commented Nov 4, 2020

Thats true! Maybe this could be compensated by adding @sealed.
Also this applies for most the classes (maybe even for all of them) in this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants