Created
December 29, 2024 18:49
-
-
Save kenzhemir/147a03626f8af79a3e1c810ff9732704 to your computer and use it in GitHub Desktop.
"Bug" in Syntax Error reporting in Google Chrome
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
/** | |
* If I run it in Google Chrome Version 131.0.6778.205 (Official Build) (64-bit), it gives the following (unexpected) error: | |
* Uncaught SyntaxError: Private field '#C' must be declared in an enclosing class | |
* If I run it in Mozilla Firefox or Node.JS or online JS compilers, they all give (expected) error: | |
* SyntaxError: Identifier 'arg' has already been declared | |
*/ | |
class Example { | |
A() { | |
this.#C() | |
} | |
B(arg) { | |
let arg | |
} | |
#C() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment