-
-
Notifications
You must be signed in to change notification settings - Fork 216
Class variables generation problem #630
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
Comments
I guess replacing the object literal with an anonymous function would do the job. Maybe have transcrypt compile to this:
but that would also make getters more verbose. Example with method that returns self.X:
|
This seems to be working pretty well. Haven't looked into the python transpile code yet, might give it a try sometime. Example.py
transcrypt.org js
Example.js
Performance for class declaration, object instantiation and method calls are the same, the memory profile seems to be the same. It also allows method redefinition of instances. |
A simpler, closer to current transcrypt and probably easier to implement version: transcrypt.org js
Examplse.js
|
when declaring class variable:
transcrypt compiles this into object of properties:
Which naturally leads to error. You need to adjust class generation mechanics.
The text was updated successfully, but these errors were encountered: