mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
raise syntax error on declaration of private method, and add syntax tests for private fields
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
| arrows.js:1:5:1:5 | Error: Argument name clash | Error: Argument name clash |
|
||||
| destructingPrivate.js:3:6:3:6 | Error: Unexpected token | Error: Unexpected token |
|
||||
| privateMethod.js:2:3:2:3 | Error: Only fields, not methods, can be declared private. | Error: Only fields, not methods, can be declared private. |
|
||||
| tst.js:2:12:2:12 | Error: Unterminated string constant | Error: Unterminated string constant |
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
bar() {
|
||||
{#privDecl} = this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class C {
|
||||
#privateMethod() {}
|
||||
}
|
||||
Reference in New Issue
Block a user