-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds support for private fields in both JS and JS Extras. [Proposal](https://github.com/tc39/proposal-class-fields#private-fields).
- Loading branch information
1 parent
9d9e2ca
commit 7bd0832
Showing
9 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
class Foo { | ||
#foo = function () { | ||
return this.#bar; | ||
} | ||
#bar = 9; | ||
|
||
get value() { | ||
return this.#foo(); | ||
} | ||
} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "class"], | ||
["class-name", [ | ||
"Foo" | ||
]], | ||
["punctuation", "{"], | ||
|
||
["function-variable", "#foo"], | ||
["operator", "="], | ||
["keyword", "function"], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", "{"], | ||
["keyword", "return"], | ||
["keyword", "this"], | ||
["punctuation", "."], | ||
"#bar", | ||
["punctuation", ";"], | ||
["punctuation", "}"], | ||
|
||
"\r\n\t#bar ", | ||
["operator", "="], | ||
["number", "9"], | ||
["punctuation", ";"], | ||
|
||
["keyword", "get"], | ||
["function", "value"], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", "{"], | ||
["keyword", "return"], | ||
["keyword", "this"], | ||
["punctuation", "."], | ||
["function", "#foo"], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", ";"], | ||
["punctuation", "}"], | ||
|
||
["punctuation", "}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for the private field syntax. |