-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat(parser): Add support for class static initialization block #219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@aladdin-add could you have a look too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
import { Context } from '../../../src/common'; | ||
import { pass, fail } from '../../test-utils'; | ||
|
||
describe('Next - Class static initialization block', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to have a few more tests. afaict, the test262 has many failing cases. tc39/test262@afe217b
we can try to add the test262 at some point, but surely it should be another PR, and won't block merging this one.
There are works to be done before we can ship it. I tried first few test262, it didn't work as expected. |
I don't have time to improve this for now. Just released v4.3.0 to include this feature. |
Attempts to fix #194 and one point from #214.
Proposal: https://github.com/tc39/proposal-class-static-block
MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Class_static_initialization_blocks
V8 examples: https://v8.dev/features/class-static-initializer-blocks
ESTree: https://github.com/estree/estree/blob/master/es2022.md#staticblock