Skip to content

Commit

Permalink
[Babel 8] Remove extra.shorthand (#16521)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu authored Jun 3, 2024
1 parent 77aeb15 commit 17a5502
Show file tree
Hide file tree
Showing 170 changed files with 37 additions and 642 deletions.
8 changes: 5 additions & 3 deletions packages/babel-parser/src/parser/expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2093,9 +2093,11 @@ export default abstract class ExpressionParser extends LValParser {
this.raise(Errors.InvalidRecordProperty, prop);
}

// @ts-expect-error shorthand may not index prop
if (prop.shorthand) {
this.addExtra(prop, "shorthand", true);
if (!process.env.BABEL_8_BREAKING) {
// @ts-expect-error shorthand may not index prop
if (prop.shorthand) {
this.addExtra(prop, "shorthand", true);
}
}

// @ts-expect-error Fixme: refine typings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@
"type": "Identifier",
"start":44,"end":45,"loc":{"start":{"line":2,"column":16,"index":44},"end":{"line":2,"column":17,"index":45},"identifierName":"f"},
"name": "f"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@
"type": "Identifier",
"start":44,"end":45,"loc":{"start":{"line":2,"column":16,"index":44},"end":{"line":2,"column":17,"index":45},"identifierName":"f"},
"name": "f"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
"type": "Identifier",
"start":8,"end":9,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":1,"column":9,"index":9},"identifierName":"b"},
"name": "b"
},
"extra": {
"shorthand": true
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
"start":22,"end":23,"loc":{"start":{"line":3,"column":2,"index":22},"end":{"line":3,"column":3,"index":23},"identifierName":"x"},
"name": "x"
},
"extra": {
"shorthand": true
},
"trailingComments": [
{
"type": "CommentBlock",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
"type": "Identifier",
"start":33,"end":38,"loc":{"start":{"line":3,"column":6,"index":33},"end":{"line":3,"column":11,"index":38},"identifierName":"spawn"},
"name": "spawn"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
"type": "Identifier",
"start":2,"end":3,"loc":{"start":{"line":1,"column":2,"index":2},"end":{"line":1,"column":3,"index":3},"identifierName":"x"},
"name": "x"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
"type": "Identifier",
"start":12,"end":22,"loc":{"start":{"line":2,"column":2,"index":12},"end":{"line":2,"column":12,"index":22},"identifierName":"break"},
"name": "break"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
},
"value": 42
}
},
"extra": {
"shorthand": true
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
},
"value": 42
}
},
"extra": {
"shorthand": true
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
},
"value": 123
}
},
"extra": {
"shorthand": true
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
"type": "Identifier",
"start":17,"end":20,"loc":{"start":{"line":2,"column":11,"index":17},"end":{"line":2,"column":14,"index":20},"identifierName":"foo"},
"name": "foo"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"type": "Identifier",
"start":22,"end":28,"loc":{"start":{"line":2,"column":8,"index":22},"end":{"line":2,"column":14,"index":28},"identifierName":"public"},
"name": "public"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"type": "Identifier",
"start":8,"end":14,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":1,"column":14,"index":14},"identifierName":"public"},
"name": "public"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"type": "Identifier",
"start":8,"end":14,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":1,"column":14,"index":14},"identifierName":"public"},
"name": "public"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"type": "Identifier",
"start":8,"end":17,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":1,"column":17,"index":17},"identifierName":"arguments"},
"name": "arguments"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
"type": "Identifier",
"start":9,"end":15,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":15,"index":15},"identifierName":"length"},
"name": "length"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
"type": "Identifier",
"start":14,"end":19,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":19,"index":19},"identifierName":"title"},
"name": "title"
},
"extra": {
"shorthand": true
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"type": "Identifier",
"start":8,"end":17,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":1,"column":17,"index":17},"identifierName":"arguments"},
"name": "arguments"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"type": "Identifier",
"start":22,"end":31,"loc":{"start":{"line":2,"column":8,"index":22},"end":{"line":2,"column":17,"index":31},"identifierName":"arguments"},
"name": "arguments"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
"start":23,"end":31,"loc":{"start":{"line":1,"column":23,"index":23},"end":{"line":1,"column":31,"index":31},"identifierName":"defValue"},
"name": "defValue"
}
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"type": "Identifier",
"start":6,"end":10,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":10,"index":10},"identifierName":"this"},
"name": "this"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"type": "Identifier",
"start":2,"end":3,"loc":{"start":{"line":1,"column":2,"index":2},"end":{"line":1,"column":3,"index":3},"identifierName":"a"},
"name": "a"
},
"extra": {
"shorthand": true
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
"type": "Identifier",
"start":10,"end":11,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":1,"column":11,"index":11},"identifierName":"a"},
"name": "a"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
"type": "Identifier",
"start":12,"end":13,"loc":{"start":{"line":1,"column":12,"index":12},"end":{"line":1,"column":13,"index":13},"identifierName":"a"},
"name": "a"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
"type": "Identifier",
"start":10,"end":11,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":1,"column":11,"index":11},"identifierName":"a"},
"name": "a"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
"type": "Identifier",
"start":10,"end":11,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":1,"column":11,"index":11},"identifierName":"a"},
"name": "a"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"type": "Identifier",
"start":6,"end":9,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":9,"index":9},"identifierName":"let"},
"name": "let"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
"type": "Identifier",
"start":8,"end":11,"loc":{"start":{"line":1,"column":8,"index":8},"end":{"line":1,"column":11,"index":11},"identifierName":"let"},
"name": "let"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
},
"value": 10
}
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
},
"value": 10
}
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"type": "Identifier",
"start":10,"end":11,"loc":{"start":{"line":2,"column":6,"index":10},"end":{"line":2,"column":7,"index":11},"identifierName":"a"},
"name": "a"
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@
},
"value": 1
}
},
"extra": {
"shorthand": true
}
}
]
Expand Down
Loading

0 comments on commit 17a5502

Please sign in to comment.