* Add support for class private methods This commit adds parser support for the TC39 Stage 2 Private Methods proposal. This commit also changes "key" in ClassPrivateProperty from an Identifier to a PrivateName, as well as disallowing #constructor as a valid private field name. * Add tests for string literal get/set/async These should be treated as regular methods and not special get/set/async behaviour. * Add tests for class private methods This also removes a test from the Test262 whitelist that failed before the changes for private methods support and now passes. * Modify class private prop tests for PrivateName * Add class private prop tests for #constructor * Fix existing ASI test case failure
17 lines
160 B
JavaScript
17 lines
160 B
JavaScript
class Foo {
|
|
a = 1;
|
|
|
|
*#a() {
|
|
yield bar();
|
|
}
|
|
|
|
#b = 2;
|
|
|
|
get b() { return 9999; }
|
|
set #c(x) { return x; }
|
|
|
|
#d() {
|
|
return Math.random();
|
|
}
|
|
}
|