Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default to hash syntax for Record&Tuple (#14744)
- Loading branch information
1 parent
74853c7
commit 14ea25f
Showing
13 changed files
with
68 additions
and
13 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
3 changes: 1 addition & 2 deletions
3
packages/babel-generator/test/fixtures/recordAndTupleSyntaxType/missing-option/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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"plugins": [["recordAndTuple", { "syntaxType": "hash" }]], | ||
"throws": "The \"recordAndTupleSyntaxType\" generator option must be \"bar\" or \"hash\" (undefined received)" | ||
"plugins": ["recordAndTuple"] | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/babel-generator/test/fixtures/recordAndTupleSyntaxType/missing-option/output.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,3 @@ | ||
#{ | ||
a: 1 | ||
}; |
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
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/experimental/record-and-tuple/default-hash/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 @@ | ||
#{ a: 1 } |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/experimental/record-and-tuple/default-hash/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": ["recordAndTuple"] | ||
} |
44 changes: 44 additions & 0 deletions
44
packages/babel-parser/test/fixtures/experimental/record-and-tuple/default-hash/output.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,44 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":9,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":9,"index":9}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":9,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":9,"index":9}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":9,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":9,"index":9}}, | ||
"expression": { | ||
"type": "RecordExpression", | ||
"start":0,"end":9,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":9,"index":9}}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start":3,"end":7,"loc":{"start":{"line":1,"column":3,"index":3},"end":{"line":1,"column":7,"index":7}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":3,"end":4,"loc":{"start":{"line":1,"column":3,"index":3},"end":{"line":1,"column":4,"index":4},"identifierName":"a"}, | ||
"name": "a" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "NumericLiteral", | ||
"start":6,"end":7,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":7,"index":7}}, | ||
"extra": { | ||
"rawValue": 1, | ||
"raw": "1" | ||
}, | ||
"value": 1 | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...l-parser/test/fixtures/experimental/record-and-tuple/invalid-type-bar-record/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"plugins": [["recordAndTuple", { "syntaxType": "invalid" }]], | ||
"throws": "'recordAndTuple' requires 'syntaxType' option whose value should be one of: 'hash', 'bar'" | ||
"throws": "The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: 'hash', 'bar'" | ||
} |
2 changes: 1 addition & 1 deletion
2
...el-parser/test/fixtures/experimental/record-and-tuple/invalid-type-bar-tuple/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"plugins": [["recordAndTuple", { "syntaxType": "invalid" }]], | ||
"throws": "'recordAndTuple' requires 'syntaxType' option whose value should be one of: 'hash', 'bar'" | ||
"throws": "The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: 'hash', 'bar'" | ||
} |
2 changes: 1 addition & 1 deletion
2
...-parser/test/fixtures/experimental/record-and-tuple/invalid-type-hash-record/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"plugins": [["recordAndTuple", { "syntaxType": "invalid" }]], | ||
"throws": "'recordAndTuple' requires 'syntaxType' option whose value should be one of: 'hash', 'bar'" | ||
"throws": "The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: 'hash', 'bar'" | ||
} |
2 changes: 1 addition & 1 deletion
2
...l-parser/test/fixtures/experimental/record-and-tuple/invalid-type-hash-tuple/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"plugins": [["recordAndTuple", { "syntaxType": "invalid" }]], | ||
"throws": "'recordAndTuple' requires 'syntaxType' option whose value should be one of: 'hash', 'bar'" | ||
"throws": "The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: 'hash', 'bar'" | ||
} |
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