-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
562eb92
commit 4739f97
Showing
141 changed files
with
1,505 additions
and
50 deletions.
There are no files selected for viewing
7 changes: 0 additions & 7 deletions
7
.../test/fixtures/experimental/class-private-methods/duplicated-accessor-method/options.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...ser/test/fixtures/experimental/class-private-methods/duplicated-field-method/options.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
.../test/fixtures/experimental/class-private-methods/duplicated-method-accessor/options.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...ser/test/fixtures/experimental/class-private-methods/duplicated-method-field/options.json
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
...abel-parser/test/fixtures/experimental/class-private-names-duplicated/README.md
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,31 @@ | ||
These tests have been generated using the following script: | ||
|
||
```js | ||
var feat = { | ||
"field": "#x = 0;", | ||
"method": "#x() {}", | ||
"get": "get #x() {}", | ||
"set": "set #x(_) {}", | ||
}; | ||
var placement = { | ||
"static": "static ", | ||
"instance": "" | ||
} | ||
|
||
for (var f1 in feat) for (var f2 in feat) for (var p1 in placement) for (var p2 in placement) { | ||
var code = `class A { | ||
${placement[p1]}${feat[f1]} | ||
${placement[p2]}${feat[f2]} | ||
}`; | ||
var name = `${p1}-${f1}-${p2}-${f2}`; | ||
var options = `{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:${2 + placement[p2].length + feat[f2].indexOf("#")})" | ||
}` | ||
var folder = "packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/" + name; | ||
|
||
if (!fs.existsSync(folder)) fs.mkdirSync(folder); | ||
fs.writeFileSync(folder + "/input.js", code); | ||
fs.writeFileSync(folder + "/options.json", options); | ||
} | ||
``` |
4 changes: 4 additions & 0 deletions
4
...xtures/experimental/class-private-names-duplicated/instance-field-instance-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 = 0; | ||
#x = 0; | ||
} |
4 changes: 4 additions & 0 deletions
4
...es/experimental/class-private-names-duplicated/instance-field-instance-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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:2)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/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 = 0; | ||
get #x() {} | ||
} |
4 changes: 4 additions & 0 deletions
4
...ures/experimental/class-private-names-duplicated/instance-field-instance-get/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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:6)" | ||
} |
2 changes: 1 addition & 1 deletion
2
...-methods/duplicated-method-field/input.js → ...d/instance-field-instance-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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class A { | ||
#x = 0; | ||
#x() {} | ||
#x; | ||
} |
4 changes: 4 additions & 0 deletions
4
...s/experimental/class-private-names-duplicated/instance-field-instance-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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:2)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/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 = 0; | ||
set #x(_) {} | ||
} |
4 changes: 4 additions & 0 deletions
4
...ures/experimental/class-private-names-duplicated/instance-field-instance-set/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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:6)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...fixtures/experimental/class-private-names-duplicated/instance-field-static-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 = 0; | ||
static #x = 0; | ||
} |
4 changes: 4 additions & 0 deletions
4
...ures/experimental/class-private-names-duplicated/instance-field-static-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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:9)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...t/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/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 = 0; | ||
static get #x() {} | ||
} |
4 changes: 4 additions & 0 deletions
4
...xtures/experimental/class-private-names-duplicated/instance-field-static-get/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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:13)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...ixtures/experimental/class-private-names-duplicated/instance-field-static-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 = 0; | ||
static #x() {} | ||
} |
4 changes: 4 additions & 0 deletions
4
...res/experimental/class-private-names-duplicated/instance-field-static-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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:9)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...t/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/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 = 0; | ||
static set #x(_) {} | ||
} |
4 changes: 4 additions & 0 deletions
4
...xtures/experimental/class-private-names-duplicated/instance-field-static-set/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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:13)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...fixtures/experimental/class-private-names-duplicated/instance-get-instance-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 { | ||
get #x() {} | ||
#x = 0; | ||
} |
4 changes: 4 additions & 0 deletions
4
...ures/experimental/class-private-names-duplicated/instance-get-instance-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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:2)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...t/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/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() {} | ||
get #x() {} | ||
} |
4 changes: 4 additions & 0 deletions
4
...xtures/experimental/class-private-names-duplicated/instance-get-instance-get/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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:6)" | ||
} |
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
...res/experimental/class-private-names-duplicated/instance-get-instance-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,4 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"], | ||
"throws": "Duplicate private name #x (3:2)" | ||
} |
4 changes: 4 additions & 0 deletions
4
...t/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/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() {} | ||
set #x(_) {} | ||
} |
3 changes: 3 additions & 0 deletions
3
...xtures/experimental/class-private-names-duplicated/instance-get-instance-set/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,3 @@ | ||
{ | ||
"plugins": ["classPrivateProperties", "classPrivateMethods"] | ||
} |
Oops, something went wrong.