Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[parser] Disallow duplicate private names
- Loading branch information
1 parent
99f4f6c
commit cec80d4
Showing
16 changed files
with
139 additions
and
83 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
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
4 changes: 4 additions & 0 deletions
4
...rser/test/fixtures/experimental/class-private-methods/duplicated-accessor-method/input.js
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,4 @@ | ||
class A { | ||
get #x() {} | ||
#x() {} | ||
} |
7 changes: 7 additions & 0 deletions
7
.../test/fixtures/experimental/class-private-methods/duplicated-accessor-method/options.json
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,7 @@ | ||
{ | ||
"plugins": [ | ||
"classPrivateMethods", | ||
"classPrivateProperties" | ||
], | ||
"throws": "Duplicate private name #x (3:2)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...-parser/test/fixtures/experimental/class-private-methods/duplicated-field-method/input.js
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,4 @@ | ||
class A { | ||
#x; | ||
#x() {} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ser/test/fixtures/experimental/class-private-methods/duplicated-field-method/options.json
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,7 @@ | ||
{ | ||
"plugins": [ | ||
"classPrivateMethods", | ||
"classPrivateProperties" | ||
], | ||
"throws": "Duplicate private name #x (3:2)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...rser/test/fixtures/experimental/class-private-methods/duplicated-method-accessor/input.js
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,4 @@ | ||
class A { | ||
#x() {} | ||
get #x() {} | ||
} |
7 changes: 7 additions & 0 deletions
7
.../test/fixtures/experimental/class-private-methods/duplicated-method-accessor/options.json
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,7 @@ | ||
{ | ||
"plugins": [ | ||
"classPrivateMethods", | ||
"classPrivateProperties" | ||
], | ||
"throws": "Duplicate private name #x (3:6)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...-parser/test/fixtures/experimental/class-private-methods/duplicated-method-field/input.js
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,4 @@ | ||
class A { | ||
#x() {} | ||
#x; | ||
} |
7 changes: 7 additions & 0 deletions
7
...ser/test/fixtures/experimental/class-private-methods/duplicated-method-field/options.json
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,7 @@ | ||
{ | ||
"plugins": [ | ||
"classPrivateMethods", | ||
"classPrivateProperties" | ||
], | ||
"throws": "Duplicate private name #x (3:2)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...st/fixtures/experimental/class-private-properties/duplicated-different-placement/input.js
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,4 @@ | ||
class A { | ||
#x = 1; | ||
static #x = 2; | ||
} |
6 changes: 6 additions & 0 deletions
6
...ixtures/experimental/class-private-properties/duplicated-different-placement/options.json
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,6 @@ | ||
{ | ||
"plugins": [ | ||
"classPrivateProperties" | ||
], | ||
"throws": "Duplicate private name #x (3:9)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...er/test/fixtures/experimental/class-private-properties/duplicated-same-placement/input.js
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,4 @@ | ||
class A { | ||
#x = 1; | ||
#x = 2; | ||
} |
6 changes: 6 additions & 0 deletions
6
...est/fixtures/experimental/class-private-properties/duplicated-same-placement/options.json
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,6 @@ | ||
{ | ||
"plugins": [ | ||
"classPrivateProperties" | ||
], | ||
"throws": "Duplicate private name #x (3:2)" | ||
} |
Oops, something went wrong.