-
Notifications
You must be signed in to change notification settings - Fork 1
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
super() does not work in playground #6
Comments
@rad-pat Could you support a PR? |
Yes, perhaps. I'm not really sure where this would need fixing though. |
I think a place where allowed words described maybe via array. |
Super can not be run in playground. Super() is exchanged by the Compiler with some base call. Playground code is not compiled. |
It'd be worth asking @johnspackman whether there is a simple RegEx that could do the translation, or if it's far more complicated than that. |
as there is no way to have super working with non ES5 classes, it could be helpful to use the following code to partly emulate super: function SUPER(instance) {
return new Proxy(instance, {
get(target, prop) {
return Object.getPrototypeOf(Object.getPrototypeOf(target))[prop].bind(target);
}
});
} (taken from here: https://stackoverflow.com/a/53802461) super().main() we could write SUPER(this).main() Just something which I came across recently during javascript investigations. |
As an example, take the TreeVritual demo from DemoBrowser https://qooxdoo.org/qxl.demobrowser/#treevirtual~TreeVirtual.html and click on the "To Playground" button. The playground will not run the code sample because of the
super().main();
. Replacing this withthis.base(arguments);
and the code sample runs ok again.The text was updated successfully, but these errors were encountered: