Skip to content

Instantly share code, notes, and snippets.

@kenzhemir
Created December 29, 2024 18:49
Show Gist options
  • Save kenzhemir/147a03626f8af79a3e1c810ff9732704 to your computer and use it in GitHub Desktop.
Save kenzhemir/147a03626f8af79a3e1c810ff9732704 to your computer and use it in GitHub Desktop.
"Bug" in Syntax Error reporting in Google Chrome
/**
* 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