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

Change class field implementation to use initializer methods #313

Merged
merged 1 commit into from Sep 29, 2018

Conversation

alangpierce
Copy link
Owner

Fixes #311

Rather than moving the assignments to the constructor or after the class body,
we now wrap them in methods that assign to either the instance or class (both
via this assignments). The generated code in the constructor or after the
class just calls those methods.

This should make line numbers always line up and should make it possible to set
debugger breakpoints in bound callback methods. It's slightly less correct, but
hopefully that won't come up in practice.

@alangpierce alangpierce force-pushed the change-class-fields-to-initializers branch from c53ee84 to c570fa2 Compare September 29, 2018 21:25
@alangpierce
Copy link
Owner Author

Updated to use symbols instead of generated names. Otherwise, subclasses might define the same name and cause trouble.

Fixes #311

Rather than moving the assignments to the constructor or after the class body,
we now wrap them in methods that assign to either the instance or class (both
via `this` assignments). The generated code in the constructor or after the
class just calls those methods.

This should make line numbers always line up and should make it possible to set
debugger breakpoints in bound callback methods. It's slightly less correct, but
hopefully that won't come up in practice.
@alangpierce alangpierce force-pushed the change-class-fields-to-initializers branch from c570fa2 to f1df8f7 Compare September 29, 2018 21:33
@alangpierce alangpierce merged commit d500b1b into master Sep 29, 2018
@alangpierce alangpierce deleted the change-class-fields-to-initializers branch October 1, 2018 00:42
@alangpierce alangpierce mentioned this pull request Nov 5, 2018
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

Successfully merging this pull request may close these issues.

None yet

1 participant