diff --git a/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0000/output.json index 8a58af3771..c00b357dad 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0000/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "+", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0001/output.json index 2c7682f5b1..b62cb03d36 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0001/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "-", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0002/output.json index 52fac917f7..3bd097397d 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-additive/migrated_0002/output.json @@ -1,31 +1,9 @@ { "type": "BinaryExpression", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "left": { "type": "StringLiteral", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -35,18 +13,7 @@ "operator": "+", "right": { "type": "NumericLiteral", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0000/output.json index 71da2d7c41..41e85774d4 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0000/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0001/output.json index 19fdd30f2f..0c8ac0803a 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0001/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "eval" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"eval"}, "name": "eval" }, "right": { "type": "NumericLiteral", - "start": 7, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":7,"end":9,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":9}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0002/output.json index beb1fc3fcb..c43eb09f8f 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0002/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "arguments" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"arguments"}, "name": "arguments" }, "right": { "type": "NumericLiteral", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":12,"end":14,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":14}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0003/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0003/output.json index 6363a8fa0e..47df6bd5ae 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0003/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0003/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "operator": "*=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0004/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0004/output.json index 0db0d4d7f4..81ea93c641 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0004/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0004/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "operator": "/=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0005/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0005/output.json index 8a143f0086..a749d96d33 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0005/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0005/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "operator": "%=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0006/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0006/output.json index 97f9783ef4..e6b0ec3db7 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0006/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0006/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "operator": "+=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0007/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0007/output.json index 096ad6ea66..20135519af 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0007/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0007/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "operator": "-=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0008/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0008/output.json index abdc6b00d8..5d7a953602 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0008/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0008/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "operator": "<<=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0009/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0009/output.json index bada0183f2..2a96022819 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0009/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0009/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "operator": ">>=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0010/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0010/output.json index 6495a0a87d..e5947c26a2 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0010/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0010/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "operator": ">>>=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 7, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":7,"end":9,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":9}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0011/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0011/output.json index 1689f0de35..2eddfbac32 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0011/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0011/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "operator": "&=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0012/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0012/output.json index 2992f0e90d..99db4d27cf 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0012/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0012/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "operator": "^=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0013/output.json b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0013/output.json index 3e04af9fc5..8dac4ff919 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0013/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-assignment/migrated_0013/output.json @@ -1,49 +1,15 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "operator": "|=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0000/output.json index 481699552e..faa4acf685 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0000/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "&", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0001/output.json index a0a6729cdc..45d5173a3d 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0001/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "^", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0002/output.json index 8a3dd3fcd8..256bae686e 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-bitwise/migrated_0002/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "|", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0000/output.json index ad159d9849..a97da5705f 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0000/output.json @@ -1,50 +1,15 @@ { "type": "LogicalExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "||", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0001/output.json index 864870d629..a09a9d867a 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0001/output.json @@ -1,50 +1,15 @@ { "type": "LogicalExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "&&", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0002/output.json index 05ef5675b0..50a153b06a 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0002/output.json @@ -1,83 +1,25 @@ { "type": "LogicalExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "left": { "type": "LogicalExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "||", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } }, "operator": "||", "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "z" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0003/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0003/output.json index 265d302699..4376c967f0 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0003/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0003/output.json @@ -1,83 +1,25 @@ { "type": "LogicalExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "left": { "type": "LogicalExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "&&", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } }, "operator": "&&", "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "z" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0004/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0004/output.json index 613c0c1899..391626b333 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0004/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0004/output.json @@ -1,82 +1,24 @@ { "type": "LogicalExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "||", "right": { "type": "LogicalExpression", - "start": 5, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":5,"end":11,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":11}}, "left": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" }, "operator": "&&", "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "z" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0005/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0005/output.json index fc3a58edf0..fc4eb8b20c 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0005/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary-logical/migrated_0005/output.json @@ -1,82 +1,24 @@ { "type": "LogicalExpression", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "||", "right": { "type": "BinaryExpression", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, "left": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" }, "operator": "^", "right": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "z" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0000/output.json index b8805a32a5..274f5defa3 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0000/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "+", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "+", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0001/output.json index 76629aed88..ea8405fa17 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0001/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "-", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "+", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0002/output.json index 9257511be1..be0ce66e88 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0002/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "+", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "-", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0003/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0003/output.json index 38ad3bef07..f78d1bd6d9 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0003/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0003/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "-", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "-", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0004/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0004/output.json index 72fd45dae5..ce40d63470 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0004/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0004/output.json @@ -1,82 +1,24 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "+", "right": { "type": "BinaryExpression", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" }, "operator": "*", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0005/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0005/output.json index 5f0c3a5870..8a03f80d29 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0005/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0005/output.json @@ -1,82 +1,24 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "+", "right": { "type": "BinaryExpression", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" }, "operator": "/", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0006/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0006/output.json index 067cb4f2e1..036e5379cd 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0006/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0006/output.json @@ -1,82 +1,24 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "-", "right": { "type": "BinaryExpression", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" }, "operator": "%", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0007/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0007/output.json index 09e30653e1..dc58e107b7 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0007/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0007/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "*", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0008/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0008/output.json index 54d5eea438..4550e84fc8 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0008/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0008/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "/", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0009/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0009/output.json index f390eee62e..a40f13f25e 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0009/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0009/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "%", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0010/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0010/output.json index 26718a96d2..8d9944d80b 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0010/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0010/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "%", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "*", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0011/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0011/output.json index 20b9316e9a..092c197306 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0011/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0011/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "<<", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } }, "operator": "<<", "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "z" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0012/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0012/output.json index ee23896542..8313ab5767 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0012/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0012/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "|", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "|", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0013/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0013/output.json index f7b90cffea..ba78658865 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0013/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0013/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "&", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "&", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0014/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0014/output.json index 4d14054161..d99d2ebe3b 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0014/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0014/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "^", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "^", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0015/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0015/output.json index 189d6d4fa3..a0ca45b2bb 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0015/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0015/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "&", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "|", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0016/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0016/output.json index 79bde08c0a..55bc9b94f7 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0016/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0016/output.json @@ -1,82 +1,24 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "|", "right": { "type": "BinaryExpression", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" }, "operator": "^", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0017/output.json b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0017/output.json index 54044292b2..47ebb54781 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0017/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-binary/migrated_0017/output.json @@ -1,82 +1,24 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "|", "right": { "type": "BinaryExpression", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9}}, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" }, "operator": "&", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0000/output.json index 8538bace1d..0a4e98ff65 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0000/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "<<", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0001/output.json index 8fc6c6e507..285e05b009 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0001/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": ">>", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0002/output.json index 3a69586a59..f4e90d497e 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-bitwise-shift/migrated_0002/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": ">>>", "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "y" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-complex/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-complex/migrated_0000/output.json index 8d705da84c..15697b3a5c 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-complex/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-complex/migrated_0000/output.json @@ -1,338 +1,96 @@ { "type": "LogicalExpression", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "a" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, "operator": "||", "right": { "type": "LogicalExpression", - "start": 5, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":5,"end":46,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "b" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"b"}, "name": "b" }, "operator": "&&", "right": { "type": "BinaryExpression", - "start": 10, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":10,"end":46,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "c" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"c"}, "name": "c" }, "operator": "|", "right": { "type": "BinaryExpression", - "start": 14, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":14,"end":46,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "d" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"d"}, "name": "d" }, "operator": "^", "right": { "type": "BinaryExpression", - "start": 18, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":18,"end":46,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "e" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"e"}, "name": "e" }, "operator": "&", "right": { "type": "BinaryExpression", - "start": 22, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":22,"end":46,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "f" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"f"}, "name": "f" }, "operator": "==", "right": { "type": "BinaryExpression", - "start": 27, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":27,"end":46,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "g" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"g"}, "name": "g" }, "operator": "<", "right": { "type": "BinaryExpression", - "start": 31, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":31,"end":46,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "h" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"h"}, "name": "h" }, "operator": ">>>", "right": { "type": "BinaryExpression", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":37,"end":46,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "i" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"i"}, "name": "i" }, "operator": "+", "right": { "type": "BinaryExpression", - "start": 41, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":41,"end":46,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":46}}, "left": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "j" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"j"}, "name": "j" }, "operator": "*", "right": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "k" - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46},"identifierName":"k"}, "name": "k" } } diff --git a/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0000/output.json index 433628a428..87a8c3ab1d 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0000/output.json @@ -1,48 +1,14 @@ { "type": "ConditionalExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "test": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "y" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"y"}, "name": "y" }, "consequent": { "type": "NumericLiteral", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5}}, "extra": { "rawValue": 1, "raw": "1" @@ -51,18 +17,7 @@ }, "alternate": { "type": "NumericLiteral", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0001/output.json index fffdd8eb2e..7349639846 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0001/output.json @@ -1,81 +1,24 @@ { "type": "ConditionalExpression", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "test": { "type": "LogicalExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "&&", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } }, "consequent": { "type": "NumericLiteral", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, "extra": { "rawValue": 1, "raw": "1" @@ -84,18 +27,7 @@ }, "alternate": { "type": "NumericLiteral", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0002/output.json index ec41f9385c..7984136251 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-conditional/migrated_0002/output.json @@ -1,63 +1,18 @@ { "type": "AssignmentExpression", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "ConditionalExpression", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15}}, "test": { "type": "NumericLiteral", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, "extra": { "rawValue": 0, "raw": "0", @@ -68,18 +23,7 @@ }, "consequent": { "type": "NumericLiteral", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, "extra": { "rawValue": 1, "raw": "1" @@ -88,18 +32,7 @@ }, "alternate": { "type": "NumericLiteral", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0000/output.json index 1cce6fe3bd..78b1acce63 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0000/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "==", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0001/output.json index 2d85183911..1b06849121 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0001/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "!=", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0002/output.json index 4485635008..5f5140e5b4 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0002/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "===", "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "y" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0003/output.json b/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0003/output.json index bd3be8cbf9..af384bc70e 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0003/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-equality/migrated_0003/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "!==", "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "y" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-grouping/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-grouping/migrated_0000/output.json index ded6b3ffc2..c674cea0f1 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-grouping/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-grouping/migrated_0000/output.json @@ -1,45 +1,12 @@ { "type": "BinaryExpression", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "left": { "type": "NumericLiteral", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, "extra": { "rawValue": 1, "raw": "1", @@ -51,18 +18,7 @@ "operator": "+", "right": { "type": "NumericLiteral", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8}}, "extra": { "rawValue": 2, "raw": "2", @@ -75,18 +31,7 @@ "operator": "+", "right": { "type": "NumericLiteral", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/expressions/esprima/expression-grouping/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-grouping/migrated_0001/output.json index aafb58f855..589fc06c03 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-grouping/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-grouping/migrated_0001/output.json @@ -1,45 +1,12 @@ { "type": "BinaryExpression", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "NumericLiteral", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1}}, "extra": { "rawValue": 4, "raw": "4" @@ -49,18 +16,7 @@ "operator": "+", "right": { "type": "NumericLiteral", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5}}, "extra": { "rawValue": 5, "raw": "5" @@ -71,18 +27,7 @@ "operator": "<<", "right": { "type": "NumericLiteral", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, "extra": { "rawValue": 6, "raw": "6", diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0000/output.json index 7b22c9ed1e..4afac7783a 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0000/output.json @@ -1,32 +1,9 @@ { "type": "NewExpression", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "callee": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "Button" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"Button"}, "name": "Button" }, "arguments": [] diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0001/output.json index 0475c36fcd..932a516064 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0001/output.json @@ -1,32 +1,9 @@ { "type": "NewExpression", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "callee": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "Button" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"Button"}, "name": "Button" }, "arguments": [] diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0002/output.json index d405075d1e..1d12c5c83e 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0002/output.json @@ -1,46 +1,12 @@ { "type": "NewExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "callee": { "type": "NewExpression", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11}}, "callee": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "foo" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0003/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0003/output.json index 7c0db2db5e..5a82df9b63 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0003/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0003/output.json @@ -1,46 +1,12 @@ { "type": "NewExpression", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "callee": { "type": "NewExpression", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13}}, "callee": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "foo" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0004/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0004/output.json index 43d431087c..2174bab285 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0004/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0004/output.json @@ -1,82 +1,25 @@ { "type": "CallExpression", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "callee": { "type": "MemberExpression", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "object": { "type": "NewExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "callee": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "foo" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"foo"}, "name": "foo" }, "arguments": [] }, + "computed": false, "property": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "bar" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0005/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0005/output.json index 5abee818be..f6a9f53dbf 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0005/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0005/output.json @@ -1,66 +1,20 @@ { "type": "NewExpression", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "callee": { "type": "MemberExpression", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12}}, "object": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "foo" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"foo"}, "name": "foo" }, + "computed": true, "property": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "bar" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"bar"}, "name": "bar" - }, - "computed": true + } }, "arguments": [] } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0006/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0006/output.json index d933742cf2..20f91ce7d6 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0006/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0006/output.json @@ -1,66 +1,20 @@ { "type": "NewExpression", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "callee": { "type": "MemberExpression", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11}}, "object": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "foo" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "bar" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0007/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0007/output.json index 9d4cbb59f2..5b22e58329 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0007/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0007/output.json @@ -1,60 +1,15 @@ { "type": "CallExpression", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "callee": { "type": "MemberExpression", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "object": { "type": "NewExpression", - "start": 2, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":2,"end":9,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":9}}, "callee": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "foo" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"foo"}, "name": "foo" }, "arguments": [], @@ -63,24 +18,12 @@ "parenStart": 0 } }, + "computed": false, "property": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "bar" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0008/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0008/output.json index b72f41c8c2..89df38dc2b 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0008/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0008/output.json @@ -1,67 +1,20 @@ { "type": "CallExpression", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "callee": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "foo" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, "arguments": [ { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "bar" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"bar"}, "name": "bar" }, { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "baz" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"baz"}, "name": "baz" } ] diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0009/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0009/output.json index 4873889321..a101af82c4 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0009/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0009/output.json @@ -1,32 +1,9 @@ { "type": "CallExpression", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "callee": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "foo" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"foo"}, "name": "foo", "extra": { "parenthesized": true, diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0010/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0010/output.json index cd2c9f9528..384e8e47c4 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0010/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0010/output.json @@ -1,50 +1,15 @@ { "type": "MemberExpression", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "milkyway" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0011/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0011/output.json index bee15d2dc8..fa057f59de 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0011/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0011/output.json @@ -1,83 +1,25 @@ { "type": "MemberExpression", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "object": { "type": "MemberExpression", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "milkyway" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "solarsystem" - }, + "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29},"identifierName":"solarsystem"}, "name": "solarsystem" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0012/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0012/output.json index a0399b6059..abfd385fc6 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0012/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0012/output.json @@ -1,116 +1,35 @@ { "type": "MemberExpression", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "object": { "type": "MemberExpression", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "object": { "type": "MemberExpression", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "milkyway" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "solarsystem" - }, + "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29},"identifierName":"solarsystem"}, "name": "solarsystem" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "Earth" - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35},"identifierName":"Earth"}, "name": "Earth" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0013/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0013/output.json index cbe933482b..0fd711dded 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0013/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0013/output.json @@ -1,84 +1,26 @@ { "type": "MemberExpression", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "SequenceExpression", - "start": 9, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":9,"end":37,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":37}}, "expressions": [ { "type": "Identifier", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "galaxyName" - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19},"identifierName":"galaxyName"}, "name": "galaxyName" }, { "type": "Identifier", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "otherUselessName" - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37},"identifierName":"otherUselessName"}, "name": "otherUselessName" } ] - }, - "computed": true + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0014/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0014/output.json index 1df38e2432..f56ffedc65 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0014/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0014/output.json @@ -1,50 +1,15 @@ { "type": "MemberExpression", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "Identifier", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "galaxyName" - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19},"identifierName":"galaxyName"}, "name": "galaxyName" - }, - "computed": true + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0015/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0015/output.json index 8d0ba0ba86..fd988659c2 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0015/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0015/output.json @@ -1,86 +1,29 @@ { "type": "MemberExpression", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "object": { "type": "MemberExpression", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "NumericLiteral", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11}}, "extra": { "rawValue": 42, "raw": "42" }, "value": 42 - }, - "computed": true + } }, + "computed": false, "property": { "type": "Identifier", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "galaxies" - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0016/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0016/output.json index 5e4456c36d..be1274538e 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0016/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0016/output.json @@ -1,63 +1,18 @@ { "type": "MemberExpression", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "object": { "type": "CallExpression", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "callee": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, "arguments": [ { "type": "NumericLiteral", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11}}, "extra": { "rawValue": 42, "raw": "42" @@ -66,22 +21,10 @@ } ] }, + "computed": false, "property": { "type": "Identifier", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "galaxies" - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0017/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0017/output.json index 1bbaa60ee2..dc25c07341 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0017/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0017/output.json @@ -1,91 +1,24 @@ { "type": "MemberExpression", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "object": { "type": "CallExpression", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "callee": { "type": "MemberExpression", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "object": { "type": "CallExpression", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "callee": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, "arguments": [ { "type": "NumericLiteral", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11}}, "extra": { "rawValue": 42, "raw": "42" @@ -94,40 +27,17 @@ } ] }, + "computed": false, "property": { "type": "Identifier", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "galaxies" - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } }, "arguments": [ { "type": "NumericLiteral", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":22,"end":24,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":24}}, "extra": { "rawValue": 14, "raw": "14" @@ -136,18 +46,7 @@ }, { "type": "NumericLiteral", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27}}, "extra": { "rawValue": 3, "raw": "3" @@ -156,18 +55,7 @@ }, { "type": "NumericLiteral", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":29,"end":31,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":31}}, "extra": { "rawValue": 77, "raw": "77" @@ -176,22 +64,10 @@ } ] }, + "computed": false, "property": { "type": "Identifier", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "milkyway" - }, + "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0018/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0018/output.json index ae391d7bab..ea8e251885 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0018/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0018/output.json @@ -1,148 +1,45 @@ { "type": "CallExpression", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "callee": { "type": "MemberExpression", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "object": { "type": "MemberExpression", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "object": { "type": "MemberExpression", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "object": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "earth" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"earth"}, "name": "earth" }, + "computed": false, "property": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "asia" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"asia"}, "name": "asia" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "Indonesia" - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20},"identifierName":"Indonesia"}, "name": "Indonesia" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", - "start": 21, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "prepareForElection" - }, + "start":21,"end":39,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":39},"identifierName":"prepareForElection"}, "name": "prepareForElection" - }, - "computed": false + } }, "arguments": [ { "type": "NumericLiteral", - "start": 40, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":40,"end":44,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":44}}, "extra": { "rawValue": 2014, "raw": "2014" diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0019/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0019/output.json index 5b193dce08..887fcca68b 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0019/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0019/output.json @@ -1,50 +1,15 @@ { "type": "MemberExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "if" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"if"}, "name": "if" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0020/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0020/output.json index 98fcf82e63..9d63d543b9 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0020/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0020/output.json @@ -1,50 +1,15 @@ { "type": "MemberExpression", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "true" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"true"}, "name": "true" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0021/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0021/output.json index ac8e3e9bf2..7a9cbb9240 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0021/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0021/output.json @@ -1,50 +1,15 @@ { "type": "MemberExpression", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "false" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"false"}, "name": "false" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0022/output.json b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0022/output.json index 93c10d6c45..48d4713b29 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0022/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-left-hand-side/migrated_0022/output.json @@ -1,50 +1,15 @@ { "type": "MemberExpression", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "object": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "universe" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "null" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"null"}, "name": "null" - }, - "computed": false + } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0000/output.json index e5899993f5..e908ee9766 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0000/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0001/output.json index f318b4797f..241345c156 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0001/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "/", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0002/output.json index eba8500fb9..88e3b2771d 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-multiplicative/migrated_0002/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "%", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0000/output.json index e5ded60507..064184cf56 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0000/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0001/output.json index e8e35594bb..00635245b1 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0001/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0002/output.json index ad76b5ded9..6200f58373 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0002/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "eval" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"eval"}, "name": "eval" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0003/output.json b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0003/output.json index 8948181a21..98753c3b5d 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0003/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0003/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "eval" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"eval"}, "name": "eval" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0004/output.json b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0004/output.json index 1abce8df59..fd597fabc8 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0004/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0004/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "arguments" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"arguments"}, "name": "arguments" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0005/output.json b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0005/output.json index 3ffb1357cb..81aff91070 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0005/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-postfix/migrated_0005/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "arguments" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"arguments"}, "name": "arguments" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0000/output.json index 4b48ac8479..423d37a926 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0000/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0001/output.json index 9b59ead154..c6621cccc4 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0001/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": ">", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0002/output.json index 83b2043a45..53ef6a3ab6 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0002/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "<=", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0003/output.json b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0003/output.json index ab60d5d4fb..ef158efa42 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0003/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0003/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": ">=", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0004/output.json b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0004/output.json index 740b947f31..52c113255d 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0004/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0004/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "in", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "y" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0005/output.json b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0005/output.json index 4b9bd9d551..4212a5f078 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0005/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0005/output.json @@ -1,50 +1,15 @@ { "type": "BinaryExpression", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "instanceof", "right": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "y" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"y"}, "name": "y" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0006/output.json b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0006/output.json index 9828724965..9778be93f2 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0006/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-relational/migrated_0006/output.json @@ -1,83 +1,25 @@ { "type": "BinaryExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "x" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "y" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"y"}, "name": "y" } }, "operator": "<", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "z" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"z"}, "name": "z" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0000/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0000/output.json index 6d39ae4da5..5845b0ee33 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0000/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0000/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "x" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0001/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0001/output.json index 3e7603926e..777ab412ef 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0001/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0001/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "x" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0002/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0002/output.json index aab442adfb..27952cebd1 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0002/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0002/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 2, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "eval" - }, + "start":2,"end":6,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":6},"identifierName":"eval"}, "name": "eval" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0003/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0003/output.json index afe6ee8197..24352bf3b5 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0003/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0003/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 2, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "eval" - }, + "start":2,"end":6,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":6},"identifierName":"eval"}, "name": "eval" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0004/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0004/output.json index 29bceec9dd..1be0249eb0 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0004/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0004/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "arguments" - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11},"identifierName":"arguments"}, "name": "arguments" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0005/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0005/output.json index 5b97f07277..6a04e0c9a6 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0005/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0005/output.json @@ -1,34 +1,11 @@ { "type": "UpdateExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "arguments" - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11},"identifierName":"arguments"}, "name": "arguments" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0006/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0006/output.json index b62c449bab..c96265b828 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0006/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0006/output.json @@ -1,34 +1,11 @@ { "type": "UnaryExpression", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "x" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0007/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0007/output.json index 6848b1b20d..5aa0d4a1d2 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0007/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0007/output.json @@ -1,34 +1,11 @@ { "type": "UnaryExpression", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "operator": "-", "prefix": true, "argument": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "x" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0008/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0008/output.json index 79a300b3a4..71728d5f5c 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0008/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0008/output.json @@ -1,34 +1,11 @@ { "type": "UnaryExpression", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "operator": "~", "prefix": true, "argument": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "x" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0009/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0009/output.json index ce26b2c69c..b779414ba4 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0009/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0009/output.json @@ -1,34 +1,11 @@ { "type": "UnaryExpression", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "operator": "!", "prefix": true, "argument": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "x" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0010/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0010/output.json index 3d5e8d435d..73958026ed 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0010/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0010/output.json @@ -1,34 +1,11 @@ { "type": "UnaryExpression", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "operator": "void", "prefix": true, "argument": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "x" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0011/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0011/output.json index 2ea515385f..764ee044f8 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0011/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0011/output.json @@ -1,34 +1,11 @@ { "type": "UnaryExpression", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "operator": "delete", "prefix": true, "argument": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "x" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0012/output.json b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0012/output.json index ef53c46f32..251d51134c 100644 --- a/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0012/output.json +++ b/packages/babel-parser/test/expressions/esprima/expression-unary/migrated_0012/output.json @@ -1,34 +1,11 @@ { "type": "UnaryExpression", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "operator": "typeof", "prefix": true, "argument": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "x" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"x"}, "name": "x" } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json index 02bdc2650e..07b4c7cae0 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json @@ -36,8 +36,8 @@ "type": "DirectiveLiteral", "start":26,"end":38,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":38}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/1/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/1/output.json index 7b549087af..73bea85920 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/1/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/1/output.json @@ -1,17 +1,5 @@ { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "myVar" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"myVar"}, "name": "myVar" } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/2/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/2/output.json index ea47978c4e..e39172b708 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/2/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/2/output.json @@ -1,60 +1,16 @@ { "type": "CallExpression", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "callee": { "type": "MemberExpression", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "object": { "type": "ArrayExpression", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "elements": [ { "type": "StringLiteral", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5}}, "extra": { "rawValue": "an", "raw": "\"an\"" @@ -63,18 +19,7 @@ }, { "type": "StringLiteral", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}}, "extra": { "rawValue": "array", "raw": "\"array\"" @@ -83,18 +28,7 @@ }, { "type": "StringLiteral", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20}}, "extra": { "rawValue": "'s", "raw": "\"'s\"" @@ -103,40 +37,17 @@ } ] }, + "computed": false, "property": { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "indexOf" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"indexOf"}, "name": "indexOf" - }, - "computed": false + } }, "arguments": [ { "type": "StringLiteral", - "start": 30, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":30,"end":37,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":37}}, "extra": { "rawValue": "index", "raw": "\"index\"" diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/3/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/3/output.json index 4eaed0b5c4..eacae9bb59 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/3/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/3/output.json @@ -1,36 +1,13 @@ { "type": "ArrowFunctionExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "a" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"a"}, "name": "a" } } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/4/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/4/output.json index 9cc5083d3a..449a5afd6a 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/4/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/4/output.json @@ -1,17 +1,5 @@ { "type": "Identifier", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "public" - }, + "start":1,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6},"identifierName":"public"}, "name": "public" } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/5/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/5/output.json index 730287d883..37545e31af 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/5/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/pass/5/output.json @@ -1,53 +1,19 @@ { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "abc" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"abc"}, "name": "abc", "trailingComments": [ { "type": "CommentLine", "value": " my comment", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17}} } ], "comments": [ { "type": "CommentLine", "value": " my comment", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/attachComment-false/array-expression-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/attachComment-false/array-expression-trailing-comma/output.json index d8c2e190a2..fee6e6d544 100644 --- a/packages/babel-parser/test/fixtures/comments/attachComment-false/array-expression-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/attachComment-false/array-expression-trailing-comma/output.json @@ -184,4 +184,4 @@ "start":221,"end":229,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":10}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json index fc95a0db28..5325e61bff 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json @@ -40,18 +40,6 @@ "raw": "\"Two\"" }, "value": "Two", - "leadingComments": [ - { - "type": "CommentLine", - "value": " One", - "start":31,"end":37,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} - }, - { - "type": "CommentLine", - "value": " Two", - "start":41,"end":47,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":9}} - } - ], "trailingComments": [ { "type": "CommentLine", @@ -63,6 +51,18 @@ "value": " Four", "start":67,"end":74,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":9}} } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " One", + "start":31,"end":37,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} + }, + { + "type": "CommentLine", + "value": " Two", + "start":41,"end":47,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":9}} + } ] } ] @@ -107,18 +107,6 @@ "raw": "\"Two\"" }, "value": "Two", - "leadingComments": [ - { - "type": "CommentLine", - "value": " One", - "start":116,"end":122,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":15}} - }, - { - "type": "CommentLine", - "value": " Two", - "start":126,"end":132,"loc":{"start":{"line":10,"column":3},"end":{"line":10,"column":9}} - } - ], "trailingComments": [ { "type": "CommentLine", @@ -130,6 +118,18 @@ "value": " Four", "start":153,"end":160,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":9}} } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " One", + "start":116,"end":122,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":15}} + }, + { + "type": "CommentLine", + "value": " Two", + "start":126,"end":132,"loc":{"start":{"line":10,"column":3},"end":{"line":10,"column":9}} + } ] } ] diff --git a/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json index 9059e207d2..e46263be37 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json @@ -22,13 +22,6 @@ "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"x"}, "name": "x", - "leadingComments": [ - { - "type": "CommentBlock", - "value": " One ", - "start":10,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} - } - ], "trailingComments": [ { "type": "CommentBlock", @@ -40,6 +33,13 @@ "value": " Three ", "start":39,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}} } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " One ", + "start":10,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} + } ] } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/arrow-function/output.json b/packages/babel-parser/test/fixtures/comments/basic/arrow-function/output.json index b0f4f03e99..0b0a27692c 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/arrow-function/output.json @@ -13,13 +13,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": "1", - "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}} - } - ], "id": null, "generator": false, "async": false, @@ -28,7 +21,14 @@ "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" - } + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": "1", + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}} + } + ] } }, { @@ -37,13 +37,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":13,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":37}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": "4", - "start":33,"end":38,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":25}} - } - ], "id": null, "generator": false, "async": false, @@ -51,13 +44,7 @@ { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7},"identifierName":"x"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "1", - "start":14,"end":19,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":6}} - } - ], + "name": "x", "trailingComments": [ { "type": "CommentBlock", @@ -70,22 +57,35 @@ "start":26,"end":31,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":18}} } ], - "name": "x" + "leadingComments": [ + { + "type": "CommentBlock", + "value": "1", + "start":14,"end":19,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":6}} + } + ] } ], "body": { "type": "BlockStatement", "start":48,"end":50,"loc":{"start":{"line":3,"column":35},"end":{"line":3,"column":37}}, + "body": [], + "directives": [], "leadingComments": [ { "type": "CommentBlock", "value": "5", "start":42,"end":47,"loc":{"start":{"line":3,"column":29},"end":{"line":3,"column":34}} } - ], - "body": [], - "directives": [] - } + ] + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": "4", + "start":33,"end":38,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":25}} + } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/async-arrow-function/output.json b/packages/babel-parser/test/fixtures/comments/basic/async-arrow-function/output.json index b75f51c4b8..f1e07fe3eb 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/async-arrow-function/output.json @@ -10,23 +10,18 @@ { "type": "ExpressionStatement", "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":43}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":45,"end":52,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":7}} - } - ], "expression": { "type": "ArrowFunctionExpression", "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":42}}, + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "Identifier", + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"x"}, + "name": "x" + }, "innerComments": [ { "type": "CommentBlock", @@ -43,31 +38,66 @@ "value": " 4 ", "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}} } - ], - "id": null, - "generator": false, - "async": true, - "params": [], - "body": { - "type": "Identifier", - "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"x"}, - "name": "x" - } - } - }, - { - "type": "ExpressionStatement", - "start":53,"end":106,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":61}}, - "leadingComments": [ + ] + }, + "trailingComments": [ { "type": "CommentBlock", "value": " 1 ", "start":45,"end":52,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":7}} } ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":53,"end":106,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":61}}, "expression": { "type": "ArrowFunctionExpression", "start":53,"end":106,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":61}}, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start":75,"end":76,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":31},"identifierName":"x"}, + "name": "x", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":76,"end":83,"loc":{"start":{"line":3,"column":31},"end":{"line":3,"column":38}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":68,"end":75,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":30}} + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start":104,"end":106,"loc":{"start":{"line":3,"column":59},"end":{"line":3,"column":61}}, + "body": [], + "directives": [], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 6 ", + "start":96,"end":103,"loc":{"start":{"line":3,"column":51},"end":{"line":3,"column":58}} + } + ] + }, "innerComments": [ { "type": "CommentBlock", @@ -79,45 +109,15 @@ "value": " 5 ", "start":85,"end":92,"loc":{"start":{"line":3,"column":40},"end":{"line":3,"column":47}} } - ], - "id": null, - "generator": false, - "async": true, - "params": [ - { - "type": "Identifier", - "start":75,"end":76,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":31},"identifierName":"x"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":68,"end":75,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":30}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":76,"end":83,"loc":{"start":{"line":3,"column":31},"end":{"line":3,"column":38}} - } - ], - "name": "x" - } - ], - "body": { - "type": "BlockStatement", - "start":104,"end":106,"loc":{"start":{"line":3,"column":59},"end":{"line":3,"column":61}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 6 ", - "start":96,"end":103,"loc":{"start":{"line":3,"column":51},"end":{"line":3,"column":58}} - } - ], - "body": [], - "directives": [] + ] + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":45,"end":52,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":7}} } - } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/comments/basic/async-call-expression/output.json b/packages/babel-parser/test/fixtures/comments/basic/async-call-expression/output.json index 1abf750eb9..7bc6bba831 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/async-call-expression/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/async-call-expression/output.json @@ -10,37 +10,37 @@ { "type": "ExpressionStatement", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}} - } - ], "expression": { "type": "CallExpression", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}} - } - ], "callee": { "type": "Identifier", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"}, + "name": "async", "trailingComments": [ { "type": "CommentBlock", "value": " 1 ", "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13}} } - ], - "name": "async" + ] }, - "arguments": [] - } + "arguments": [], + "innerComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/comments/basic/async-do-expression/output.json b/packages/babel-parser/test/fixtures/comments/basic/async-do-expression/output.json index 481331445e..bc156f9935 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/async-do-expression/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/async-do-expression/output.json @@ -10,41 +10,15 @@ { "type": "ExpressionStatement", "start":7,"end":37,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":37}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 5 ", - "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44}} - } - ], "expression": { "type": "DoExpression", "start":7,"end":37,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":37}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}} - } - ], "async": true, "body": { "type": "BlockStatement", "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}} - } - ], + "body": [], + "directives": [], "innerComments": [ { "type": "CommentBlock", @@ -52,10 +26,36 @@ "start":29,"end":36,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":36}} } ], - "body": [], - "directives": [] + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}} + } + ] + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 5 ", + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44}} } - } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/comments/basic/async-function/output.json b/packages/babel-parser/test/fixtures/comments/basic/async-function/output.json index 1cc9422626..b2b5290205 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/async-function/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/async-function/output.json @@ -10,20 +10,6 @@ { "type": "FunctionDeclaration", "start":7,"end":35,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":35}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}} - } - ], "id": { "type": "Identifier", "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"f"}, @@ -37,7 +23,21 @@ "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] - } + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] @@ -54,4 +54,4 @@ "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/call-expression-no-argument/output.json b/packages/babel-parser/test/fixtures/comments/basic/call-expression-no-argument/output.json index 97cde7e8ff..391c7bd12d 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/call-expression-no-argument/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/call-expression-no-argument/output.json @@ -13,26 +13,26 @@ "expression": { "type": "CallExpression", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}} - } - ], "callee": { "type": "Identifier", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, + "name": "foo", "trailingComments": [ { "type": "CommentBlock", "value": " 1 ", "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11}} } - ], - "name": "foo" + ] }, - "arguments": [] + "arguments": [], + "innerComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}} + } + ] } } ], @@ -50,4 +50,4 @@ "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/class-accessor-computed/output.json b/packages/babel-parser/test/fixtures/comments/basic/class-accessor-computed/output.json index fdd022eeb8..5b0a0b7b69 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/class-accessor-computed/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/class-accessor-computed/output.json @@ -13,10 +13,6 @@ "expression": { "type": "ClassExpression", "start":1,"end":97,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":97}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "superClass": null, "body": { @@ -26,36 +22,11 @@ { "type": "ClassMethod", "start":17,"end":95,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":95}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}} - }, - { - "type": "CommentBlock", - "value": " 5 ", - "start":48,"end":55,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":55}} - } - ], "static": false, "key": { "type": "Identifier", "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":31,"end":38,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":38}} - } - ], + "name": "f", "trailingComments": [ { "type": "CommentBlock", @@ -63,7 +34,13 @@ "start":39,"end":46,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":46}} } ], - "name": "f" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":31,"end":38,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":38}} + } + ] }, "computed": true, "kind": "set", @@ -74,13 +51,7 @@ { "type": "Identifier", "start":65,"end":66,"loc":{"start":{"line":1,"column":65},"end":{"line":1,"column":66},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 6 ", - "start":57,"end":64,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":64}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -93,24 +64,53 @@ "start":76,"end":83,"loc":{"start":{"line":1,"column":76},"end":{"line":1,"column":83}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 6 ", + "start":57,"end":64,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":64}} + } + ] } ], "body": { "type": "BlockStatement", "start":93,"end":95,"loc":{"start":{"line":1,"column":93},"end":{"line":1,"column":95}}, + "body": [], + "directives": [], "leadingComments": [ { "type": "CommentBlock", "value": " 9 ", "start":85,"end":92,"loc":{"start":{"line":1,"column":85},"end":{"line":1,"column":92}} } - ], - "body": [], - "directives": [] - } + ] + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}} + }, + { + "type": "CommentBlock", + "value": " 5 ", + "start":48,"end":55,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":55}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}} + } + ] } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } }, @@ -120,10 +120,6 @@ "expression": { "type": "ClassExpression", "start":101,"end":178,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":78}}, - "extra": { - "parenthesized": true, - "parenStart": 100 - }, "id": null, "superClass": null, "body": { @@ -133,13 +129,45 @@ { "type": "ClassMethod", "start":117,"end":176,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":76}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":109,"end":116,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16}} - } - ], + "static": false, + "key": { + "type": "Identifier", + "start":138,"end":139,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":39},"identifierName":"f"}, + "name": "f", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":139,"end":146,"loc":{"start":{"line":2,"column":39},"end":{"line":2,"column":46}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":131,"end":138,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":38}} + } + ] + }, + "computed": true, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":174,"end":176,"loc":{"start":{"line":2,"column":74},"end":{"line":2,"column":76}}, + "body": [], + "directives": [], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 7 ", + "start":166,"end":173,"loc":{"start":{"line":2,"column":66},"end":{"line":2,"column":73}} + } + ] + }, "innerComments": [ { "type": "CommentBlock", @@ -157,47 +185,19 @@ "start":157,"end":164,"loc":{"start":{"line":2,"column":57},"end":{"line":2,"column":64}} } ], - "static": false, - "key": { - "type": "Identifier", - "start":138,"end":139,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":39},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":131,"end":138,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":38}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":139,"end":146,"loc":{"start":{"line":2,"column":39},"end":{"line":2,"column":46}} - } - ], - "name": "f" - }, - "computed": true, - "kind": "get", - "id": null, - "generator": false, - "async": false, - "params": [], - "body": { - "type": "BlockStatement", - "start":174,"end":176,"loc":{"start":{"line":2,"column":74},"end":{"line":2,"column":76}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 7 ", - "start":166,"end":173,"loc":{"start":{"line":2,"column":66},"end":{"line":2,"column":73}} - } - ], - "body": [], - "directives": [] - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":109,"end":116,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16}} + } + ] } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 100 } } }, @@ -207,10 +207,6 @@ "expression": { "type": "ClassExpression", "start":182,"end":213,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":32}}, - "extra": { - "parenthesized": true, - "parenStart": 181 - }, "id": null, "superClass": null, "body": { @@ -220,13 +216,6 @@ { "type": "ClassMethod", "start":190,"end":211,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":30}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":194,"end":201,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":20}} - } - ], "static": false, "key": { "type": "Identifier", @@ -244,9 +233,20 @@ "start":209,"end":211,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":30}}, "body": [], "directives": [] - } + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":194,"end":201,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":20}} + } + ] } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 181 } } } diff --git a/packages/babel-parser/test/fixtures/comments/basic/class-method-async-generator/output.json b/packages/babel-parser/test/fixtures/comments/basic/class-method-async-generator/output.json index b8b2927397..713793b0ae 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/class-method-async-generator/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/class-method-async-generator/output.json @@ -23,31 +23,11 @@ { "type": "ClassMethod", "start":18,"end":91,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":91}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}} - } - ], "static": false, "key": { "type": "Identifier", "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":34,"end":41,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":41}} - } - ], + "name": "f", "trailingComments": [ { "type": "CommentBlock", @@ -55,7 +35,13 @@ "start":44,"end":51,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":51}} } ], - "name": "f" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":34,"end":41,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":41}} + } + ] }, "computed": false, "kind": "method", @@ -66,13 +52,7 @@ { "type": "Identifier", "start":61,"end":62,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":62},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 5 ", - "start":53,"end":60,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":60}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -85,22 +65,42 @@ "start":72,"end":79,"loc":{"start":{"line":1,"column":72},"end":{"line":1,"column":79}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 5 ", + "start":53,"end":60,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":60}} + } + ] } ], "body": { "type": "BlockStatement", "start":89,"end":91,"loc":{"start":{"line":1,"column":89},"end":{"line":1,"column":91}}, + "body": [], + "directives": [], "leadingComments": [ { "type": "CommentBlock", "value": " 8 ", "start":81,"end":88,"loc":{"start":{"line":1,"column":81},"end":{"line":1,"column":88}} } - ], - "body": [], - "directives": [] - } + ] + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}} + } + ] } ] } @@ -111,10 +111,6 @@ "expression": { "type": "ClassExpression", "start":95,"end":127,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":33}}, - "extra": { - "parenthesized": true, - "parenStart": 94 - }, "id": null, "superClass": null, "body": { @@ -124,13 +120,6 @@ { "type": "ClassMethod", "start":103,"end":125,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":31}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":109,"end":116,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}} - } - ], "static": false, "key": { "type": "Identifier", @@ -148,9 +137,20 @@ "start":123,"end":125,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":31}}, "body": [], "directives": [] - } + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":109,"end":116,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}} + } + ] } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 94 } } } diff --git a/packages/babel-parser/test/fixtures/comments/basic/class-method-static-generator/output.json b/packages/babel-parser/test/fixtures/comments/basic/class-method-static-generator/output.json index b6336d1784..aebd6a27ba 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/class-method-static-generator/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/class-method-static-generator/output.json @@ -13,47 +13,61 @@ "expression": { "type": "ClassExpression", "start":1,"end":99,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":99}}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 10 ", - "start":100,"end":108,"loc":{"start":{"line":1,"column":100},"end":{"line":1,"column":108}} - } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "superClass": null, "body": { "type": "ClassBody", "start":15,"end":99,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":99}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}} - } - ], "body": [ { "type": "ClassMethod", "start":25,"end":89,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":89}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 9 ", - "start":90,"end":97,"loc":{"start":{"line":1,"column":90},"end":{"line":1,"column":97}} - } - ], + "static": true, + "kind": "method", + "key": { + "type": "Identifier", + "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51},"identifierName":"f"}, + "name": "f", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 5 ", + "start":52,"end":59,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":59}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":42,"end":49,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":49}} + } + ] + }, + "computed": false, + "id": null, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":78,"end":89,"loc":{"start":{"line":1,"column":78},"end":{"line":1,"column":89}}, + "body": [], + "directives": [], + "innerComments": [ + { + "type": "CommentBlock", + "value": " 8 ", + "start":80,"end":87,"loc":{"start":{"line":1,"column":80},"end":{"line":1,"column":87}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 7 ", + "start":70,"end":77,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":77}} + } + ] + }, "innerComments": [ { "type": "CommentBlock", @@ -66,55 +80,41 @@ "start":61,"end":68,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":68}} } ], - "static": true, - "kind": "method", - "key": { - "type": "Identifier", - "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":42,"end":49,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":49}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 5 ", - "start":52,"end":59,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":59}} - } - ], - "name": "f" - }, - "computed": false, - "id": null, - "generator": true, - "async": false, - "params": [], - "body": { - "type": "BlockStatement", - "start":78,"end":89,"loc":{"start":{"line":1,"column":78},"end":{"line":1,"column":89}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 7 ", - "start":70,"end":77,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":77}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": " 8 ", - "start":80,"end":87,"loc":{"start":{"line":1,"column":80},"end":{"line":1,"column":87}} - } - ], - "body": [], - "directives": [] - } + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 9 ", + "start":90,"end":97,"loc":{"start":{"line":1,"column":90},"end":{"line":1,"column":97}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} + } + ] + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}} } ] - } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 10 ", + "start":100,"end":108,"loc":{"start":{"line":1,"column":100},"end":{"line":1,"column":108}} + } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/class-method/output.json b/packages/babel-parser/test/fixtures/comments/basic/class-method/output.json index 8cbdd4dff9..e446f81628 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/class-method/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/class-method/output.json @@ -13,66 +13,27 @@ "expression": { "type": "ClassExpression", "start":9,"end":102,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":102}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 11 ", - "start":103,"end":111,"loc":{"start":{"line":1,"column":103},"end":{"line":1,"column":111}} - } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "superClass": null, "body": { "type": "ClassBody", "start":23,"end":102,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":102}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}} - } - ], "body": [ { "type": "ClassMethod", "start":33,"end":91,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":91}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 10 ", - "start":92,"end":100,"loc":{"start":{"line":1,"column":92},"end":{"line":1,"column":100}} - } - ], "static": false, "key": { "type": "Identifier", "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"f"}, + "name": "f", "trailingComments": [ { "type": "CommentBlock", "value": " 4 ", "start":35,"end":42,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":42}} } - ], - "name": "f" + ] }, "computed": false, "kind": "method", @@ -83,13 +44,7 @@ { "type": "Identifier", "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 5 ", - "start":44,"end":51,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":51}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -102,19 +57,20 @@ "start":63,"end":70,"loc":{"start":{"line":1,"column":63},"end":{"line":1,"column":70}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 5 ", + "start":44,"end":51,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":51}} + } + ] } ], "body": { "type": "BlockStatement", "start":80,"end":91,"loc":{"start":{"line":1,"column":80},"end":{"line":1,"column":91}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 8 ", - "start":72,"end":79,"loc":{"start":{"line":1,"column":72},"end":{"line":1,"column":79}} - } - ], + "body": [], + "directives": [], "innerComments": [ { "type": "CommentBlock", @@ -122,12 +78,56 @@ "start":82,"end":89,"loc":{"start":{"line":1,"column":82},"end":{"line":1,"column":89}} } ], - "body": [], - "directives": [] - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 8 ", + "start":72,"end":79,"loc":{"start":{"line":1,"column":72},"end":{"line":1,"column":79}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 10 ", + "start":92,"end":100,"loc":{"start":{"line":1,"column":92},"end":{"line":1,"column":100}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}} + } + ] + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}} } ] - } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 11 ", + "start":103,"end":111,"loc":{"start":{"line":1,"column":103},"end":{"line":1,"column":111}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}} + } + ] } }, { @@ -136,63 +136,31 @@ "expression": { "type": "ClassExpression", "start":115,"end":208,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":94}}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 10 ", - "start":209,"end":217,"loc":{"start":{"line":2,"column":95},"end":{"line":2,"column":103}} - } - ], - "extra": { - "parenthesized": true, - "parenStart": 114 - }, "id": null, "superClass": null, "body": { "type": "ClassBody", "start":129,"end":208,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":94}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":121,"end":128,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":14}} - } - ], "body": [ { "type": "ClassPrivateMethod", "start":139,"end":198,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":84}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":131,"end":138,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":24}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 9 ", - "start":199,"end":206,"loc":{"start":{"line":2,"column":85},"end":{"line":2,"column":92}} - } - ], "static": false, "key": { "type": "PrivateName", "start":139,"end":141,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}}, + "id": { + "type": "Identifier", + "start":140,"end":141,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":27},"identifierName":"f"}, + "name": "f" + }, "trailingComments": [ { "type": "CommentBlock", "value": " 3 ", "start":142,"end":149,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":35}} } - ], - "id": { - "type": "Identifier", - "start":140,"end":141,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":27},"identifierName":"f"}, - "name": "f" - } + ] }, "kind": "method", "id": null, @@ -202,13 +170,7 @@ { "type": "Identifier", "start":159,"end":160,"loc":{"start":{"line":2,"column":45},"end":{"line":2,"column":46},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":151,"end":158,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":44}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -221,19 +183,20 @@ "start":170,"end":177,"loc":{"start":{"line":2,"column":56},"end":{"line":2,"column":63}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":151,"end":158,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":44}} + } + ] } ], "body": { "type": "BlockStatement", "start":187,"end":198,"loc":{"start":{"line":2,"column":73},"end":{"line":2,"column":84}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 7 ", - "start":179,"end":186,"loc":{"start":{"line":2,"column":65},"end":{"line":2,"column":72}} - } - ], + "body": [], + "directives": [], "innerComments": [ { "type": "CommentBlock", @@ -241,12 +204,49 @@ "start":189,"end":196,"loc":{"start":{"line":2,"column":75},"end":{"line":2,"column":82}} } ], - "body": [], - "directives": [] - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 7 ", + "start":179,"end":186,"loc":{"start":{"line":2,"column":65},"end":{"line":2,"column":72}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 9 ", + "start":199,"end":206,"loc":{"start":{"line":2,"column":85},"end":{"line":2,"column":92}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":131,"end":138,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":24}} + } + ] + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":121,"end":128,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":14}} } ] - } + }, + "extra": { + "parenthesized": true, + "parenStart": 114 + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 10 ", + "start":209,"end":217,"loc":{"start":{"line":2,"column":95},"end":{"line":2,"column":103}} + } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/class-private-method/output.json b/packages/babel-parser/test/fixtures/comments/basic/class-private-method/output.json index 231a18cc78..aea2cc8dbc 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/class-private-method/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/class-private-method/output.json @@ -13,70 +13,31 @@ "expression": { "type": "ClassExpression", "start":9,"end":103,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":103}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 11 ", - "start":104,"end":112,"loc":{"start":{"line":1,"column":104},"end":{"line":1,"column":112}} - } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "superClass": null, "body": { "type": "ClassBody", "start":23,"end":103,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":103}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}} - } - ], "body": [ { "type": "ClassPrivateMethod", "start":33,"end":92,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":92}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 10 ", - "start":93,"end":101,"loc":{"start":{"line":1,"column":93},"end":{"line":1,"column":101}} - } - ], "static": false, "key": { "type": "PrivateName", "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, + "id": { + "type": "Identifier", + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"f"}, + "name": "f" + }, "trailingComments": [ { "type": "CommentBlock", "value": " 4 ", "start":36,"end":43,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":43}} } - ], - "id": { - "type": "Identifier", - "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"f"}, - "name": "f" - } + ] }, "kind": "method", "id": null, @@ -86,13 +47,7 @@ { "type": "Identifier", "start":53,"end":54,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":54},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 5 ", - "start":45,"end":52,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":52}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -105,19 +60,20 @@ "start":64,"end":71,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":71}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 5 ", + "start":45,"end":52,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":52}} + } + ] } ], "body": { "type": "BlockStatement", "start":81,"end":92,"loc":{"start":{"line":1,"column":81},"end":{"line":1,"column":92}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 8 ", - "start":73,"end":80,"loc":{"start":{"line":1,"column":73},"end":{"line":1,"column":80}} - } - ], + "body": [], + "directives": [], "innerComments": [ { "type": "CommentBlock", @@ -125,12 +81,56 @@ "start":83,"end":90,"loc":{"start":{"line":1,"column":83},"end":{"line":1,"column":90}} } ], - "body": [], - "directives": [] - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 8 ", + "start":73,"end":80,"loc":{"start":{"line":1,"column":73},"end":{"line":1,"column":80}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 10 ", + "start":93,"end":101,"loc":{"start":{"line":1,"column":93},"end":{"line":1,"column":101}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}} + } + ] + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}} } ] - } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 11 ", + "start":104,"end":112,"loc":{"start":{"line":1,"column":104},"end":{"line":1,"column":112}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}} + } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/class-static-block/output.json b/packages/babel-parser/test/fixtures/comments/basic/class-static-block/output.json index e118bbb4f1..6c5fc1a0e2 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/class-static-block/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/class-static-block/output.json @@ -13,47 +13,16 @@ "expression": { "type": "ClassExpression", "start":1,"end":59,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":59}}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 6 ", - "start":60,"end":67,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":67}} - } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "superClass": null, "body": { "type": "ClassBody", "start":15,"end":59,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":59}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}} - } - ], "body": [ { "type": "StaticBlock", "start":25,"end":49,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":49}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 5 ", - "start":50,"end":57,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":57}} - } - ], + "body": [], "innerComments": [ { "type": "CommentBlock", @@ -66,10 +35,41 @@ "start":41,"end":48,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":48}} } ], - "body": [] + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 5 ", + "start":50,"end":57,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":57}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} + } + ] + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}} } ] - } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 6 ", + "start":60,"end":67,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":67}} + } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/create-parenthesized-expressions/output.json b/packages/babel-parser/test/fixtures/comments/basic/create-parenthesized-expressions/output.json index d8c108f4bf..368889106d 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/create-parenthesized-expressions/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/create-parenthesized-expressions/output.json @@ -23,19 +23,19 @@ "value": 1 } }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " One", - "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}} - } - ], "trailingComments": [ { "type": "CommentBlock", "value": " Two ", "start":13,"end":22,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}} } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " One", + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}} + } ] }, { diff --git a/packages/babel-parser/test/fixtures/comments/basic/directive/output.json b/packages/babel-parser/test/fixtures/comments/basic/directive/output.json index 752ac6c915..48b2dc2e3c 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/directive/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/directive/output.json @@ -11,13 +11,22 @@ { "type": "Directive", "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], + "value": { + "type": "DirectiveLiteral", + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, + "extra": { + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}} + } + ] + }, "trailingComments": [ { "type": "CommentBlock", @@ -25,22 +34,13 @@ "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}} } ], - "value": { - "type": "DirectiveLiteral", - "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}} - } - ], - "extra": { - "rawValue": "use strict", - "raw": "\"use strict\"" - }, - "value": "use strict" - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ] }, diff --git a/packages/babel-parser/test/fixtures/comments/basic/function/output.json b/packages/babel-parser/test/fixtures/comments/basic/function/output.json index 367b69f088..567f2cdf82 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/function/output.json @@ -10,30 +10,10 @@ { "type": "FunctionDeclaration", "start":8,"end":83,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":83}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 9 ", - "start":84,"end":91,"loc":{"start":{"line":1,"column":84},"end":{"line":1,"column":91}} - } - ], "id": { "type": "Identifier", "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} - } - ], + "name": "f", "trailingComments": [ { "type": "CommentBlock", @@ -41,7 +21,13 @@ "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}} } ], - "name": "f" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} + } + ] }, "generator": false, "async": false, @@ -49,13 +35,7 @@ { "type": "Identifier", "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":36,"end":43,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":43}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -68,19 +48,20 @@ "start":55,"end":62,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":62}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":36,"end":43,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":43}} + } + ] } ], "body": { "type": "BlockStatement", "start":72,"end":83,"loc":{"start":{"line":1,"column":72},"end":{"line":1,"column":83}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 7 ", - "start":64,"end":71,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":71}} - } - ], + "body": [], + "directives": [], "innerComments": [ { "type": "CommentBlock", @@ -88,51 +69,39 @@ "start":74,"end":81,"loc":{"start":{"line":1,"column":74},"end":{"line":1,"column":81}} } ], - "body": [], - "directives": [] - } - }, - { - "type": "ExpressionStatement", - "start":92,"end":186,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":94}}, - "leadingComments": [ + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 7 ", + "start":64,"end":71,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":71}} + } + ] + }, + "trailingComments": [ { "type": "CommentBlock", "value": " 9 ", "start":84,"end":91,"loc":{"start":{"line":1,"column":84},"end":{"line":1,"column":91}} } ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":92,"end":186,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":94}}, "expression": { "type": "FunctionExpression", "start":101,"end":176,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":84}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":93,"end":100,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":8}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 9 ", - "start":177,"end":184,"loc":{"start":{"line":2,"column":85},"end":{"line":2,"column":92}} - } - ], - "extra": { - "parenthesized": true, - "parenStart": 92 - }, "id": { "type": "Identifier", "start":118,"end":119,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":27},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":110,"end":117,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":25}} - } - ], + "name": "f", "trailingComments": [ { "type": "CommentBlock", @@ -140,7 +109,13 @@ "start":120,"end":127,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":35}} } ], - "name": "f" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":110,"end":117,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":25}} + } + ] }, "generator": false, "async": false, @@ -148,13 +123,7 @@ { "type": "Identifier", "start":137,"end":138,"loc":{"start":{"line":2,"column":45},"end":{"line":2,"column":46},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":129,"end":136,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":44}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -167,19 +136,20 @@ "start":148,"end":155,"loc":{"start":{"line":2,"column":56},"end":{"line":2,"column":63}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":129,"end":136,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":44}} + } + ] } ], "body": { "type": "BlockStatement", "start":165,"end":176,"loc":{"start":{"line":2,"column":73},"end":{"line":2,"column":84}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 7 ", - "start":157,"end":164,"loc":{"start":{"line":2,"column":65},"end":{"line":2,"column":72}} - } - ], + "body": [], + "directives": [], "innerComments": [ { "type": "CommentBlock", @@ -187,10 +157,40 @@ "start":167,"end":174,"loc":{"start":{"line":2,"column":75},"end":{"line":2,"column":82}} } ], - "body": [], - "directives": [] + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 7 ", + "start":157,"end":164,"loc":{"start":{"line":2,"column":65},"end":{"line":2,"column":72}} + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 92 + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 9 ", + "start":177,"end":184,"loc":{"start":{"line":2,"column":85},"end":{"line":2,"column":92}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":93,"end":100,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":8}} + } + ] + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 9 ", + "start":84,"end":91,"loc":{"start":{"line":1,"column":84},"end":{"line":1,"column":91}} } - } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-accessor-computed/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-accessor-computed/output.json index fe999b322c..5df3588472 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-accessor-computed/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/object-accessor-computed/output.json @@ -13,44 +13,15 @@ "expression": { "type": "ObjectExpression", "start":1,"end":91,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":91}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", "start":11,"end":89,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":89}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}} - }, - { - "type": "CommentBlock", - "value": " 5 ", - "start":42,"end":49,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":49}} - } - ], "method": false, "key": { "type": "Identifier", "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}} - } - ], + "name": "f", "trailingComments": [ { "type": "CommentBlock", @@ -58,7 +29,13 @@ "start":33,"end":40,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":40}} } ], - "name": "f" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}} + } + ] }, "computed": true, "kind": "set", @@ -69,13 +46,7 @@ { "type": "Identifier", "start":59,"end":60,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":60},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 6 ", - "start":51,"end":58,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":58}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -88,24 +59,53 @@ "start":70,"end":77,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":77}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 6 ", + "start":51,"end":58,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":58}} + } + ] } ], "body": { "type": "BlockStatement", "start":87,"end":89,"loc":{"start":{"line":1,"column":87},"end":{"line":1,"column":89}}, + "body": [], + "directives": [], "leadingComments": [ { "type": "CommentBlock", "value": " 9 ", "start":79,"end":86,"loc":{"start":{"line":1,"column":79},"end":{"line":1,"column":86}} } - ], - "body": [], - "directives": [] - } + ] + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}} + }, + { + "type": "CommentBlock", + "value": " 5 ", + "start":42,"end":49,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":49}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}} + } + ] } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } }, { @@ -114,21 +114,49 @@ "expression": { "type": "ObjectExpression", "start":95,"end":166,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":72}}, - "extra": { - "parenthesized": true, - "parenStart": 94 - }, "properties": [ { "type": "ObjectMethod", "start":105,"end":164,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":70}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":97,"end":104,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":10}} - } - ], + "method": false, + "key": { + "type": "Identifier", + "start":126,"end":127,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":33},"identifierName":"f"}, + "name": "f", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":127,"end":134,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":40}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":119,"end":126,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":32}} + } + ] + }, + "computed": true, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":162,"end":164,"loc":{"start":{"line":2,"column":68},"end":{"line":2,"column":70}}, + "body": [], + "directives": [], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 7 ", + "start":154,"end":161,"loc":{"start":{"line":2,"column":60},"end":{"line":2,"column":67}} + } + ] + }, "innerComments": [ { "type": "CommentBlock", @@ -146,47 +174,19 @@ "start":145,"end":152,"loc":{"start":{"line":2,"column":51},"end":{"line":2,"column":58}} } ], - "method": false, - "key": { - "type": "Identifier", - "start":126,"end":127,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":33},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":119,"end":126,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":32}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":127,"end":134,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":40}} - } - ], - "name": "f" - }, - "computed": true, - "kind": "get", - "id": null, - "generator": false, - "async": false, - "params": [], - "body": { - "type": "BlockStatement", - "start":162,"end":164,"loc":{"start":{"line":2,"column":68},"end":{"line":2,"column":70}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 7 ", - "start":154,"end":161,"loc":{"start":{"line":2,"column":60},"end":{"line":2,"column":67}} - } - ], - "body": [], - "directives": [] - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":97,"end":104,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":10}} + } + ] } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 94 + } } }, { @@ -195,21 +195,10 @@ "expression": { "type": "ObjectExpression", "start":170,"end":195,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 169 - }, "properties": [ { "type": "ObjectMethod", "start":172,"end":193,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":24}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":176,"end":183,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":14}} - } - ], "method": false, "key": { "type": "Identifier", @@ -227,9 +216,20 @@ "start":191,"end":193,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":24}}, "body": [], "directives": [] - } + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":176,"end":183,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":14}} + } + ] } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 169 + } } } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json index e016e28ae9..be8cddfbe9 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json @@ -34,13 +34,9 @@ "start":22,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"x"}, "name": "x" }, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " One ", - "start":10,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} - } - ], + "extra": { + "shorthand": true + }, "trailingComments": [ { "type": "CommentBlock", @@ -53,9 +49,13 @@ "start":39,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}} } ], - "extra": { - "shorthand": true - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " One ", + "start":10,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} + } + ] } ], "extra": { diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-method-async-generator/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-method-async-generator/output.json index f7e58e7b50..613fbce0f7 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-method-async-generator/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/object-method-async-generator/output.json @@ -16,39 +16,15 @@ "callee": { "type": "ObjectExpression", "start":1,"end":86,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":86}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", "start":11,"end":84,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":84}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} - } - ], "method": true, "key": { "type": "Identifier", "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"f"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 3 ", - "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}} - } - ], + "name": "f", "trailingComments": [ { "type": "CommentBlock", @@ -56,7 +32,13 @@ "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44}} } ], - "name": "f" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 3 ", + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}} + } + ] }, "computed": false, "kind": "method", @@ -67,13 +49,7 @@ { "type": "Identifier", "start":54,"end":55,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":55},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 5 ", - "start":46,"end":53,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":53}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -86,24 +62,48 @@ "start":65,"end":72,"loc":{"start":{"line":1,"column":65},"end":{"line":1,"column":72}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 5 ", + "start":46,"end":53,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":53}} + } + ] } ], "body": { "type": "BlockStatement", "start":82,"end":84,"loc":{"start":{"line":1,"column":82},"end":{"line":1,"column":84}}, + "body": [], + "directives": [], "leadingComments": [ { "type": "CommentBlock", "value": " 8 ", "start":74,"end":81,"loc":{"start":{"line":1,"column":74},"end":{"line":1,"column":81}} } - ], - "body": [], - "directives": [] - } + ] + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}} + } + ] } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } }, "arguments": [ { @@ -113,13 +113,6 @@ { "type": "ObjectMethod", "start":91,"end":113,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":25}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":97,"end":104,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16}} - } - ], "method": true, "key": { "type": "Identifier", @@ -137,7 +130,14 @@ "start":111,"end":113,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25}}, "body": [], "directives": [] - } + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":97,"end":104,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16}} + } + ] } ] } diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-method/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-method/output.json index f1604cd7dd..a1fb0cc8bd 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-method/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/object-method/output.json @@ -13,54 +13,22 @@ "expression": { "type": "ObjectExpression", "start":9,"end":87,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":87}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 10 ", - "start":88,"end":96,"loc":{"start":{"line":1,"column":88},"end":{"line":1,"column":96}} - } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", "start":19,"end":77,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":77}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 9 ", - "start":78,"end":85,"loc":{"start":{"line":1,"column":78},"end":{"line":1,"column":85}} - } - ], "method": true, "key": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"f"}, + "name": "f", "trailingComments": [ { "type": "CommentBlock", "value": " 3 ", "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}} } - ], - "name": "f" + ] }, "computed": false, "kind": "method", @@ -71,13 +39,7 @@ { "type": "Identifier", "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"a"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":30,"end":37,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":37}} - } - ], + "name": "a", "trailingComments": [ { "type": "CommentBlock", @@ -90,19 +52,20 @@ "start":49,"end":56,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":56}} } ], - "name": "a" + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":30,"end":37,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":37}} + } + ] } ], "body": { "type": "BlockStatement", "start":66,"end":77,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":77}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 7 ", - "start":58,"end":65,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":65}} - } - ], + "body": [], + "directives": [], "innerComments": [ { "type": "CommentBlock", @@ -110,9 +73,46 @@ "start":68,"end":75,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":75}} } ], - "body": [], - "directives": [] - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 7 ", + "start":58,"end":65,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":65}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 9 ", + "start":78,"end":85,"loc":{"start":{"line":1,"column":78},"end":{"line":1,"column":85}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}} + } + ] + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 10 ", + "start":88,"end":96,"loc":{"start":{"line":1,"column":88},"end":{"line":1,"column":96}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}} } ] } diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json index 2455490bd6..f7248908b5 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json @@ -92,19 +92,19 @@ }, "value": "3" }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " comment 2", - "start":45,"end":57,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":22}} - } - ], "trailingComments": [ { "type": "CommentLine", "value": " comment 3", "start":68,"end":80,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":22}} } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " comment 2", + "start":45,"end":57,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":22}} + } ] } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/sequence-expression/output.json b/packages/babel-parser/test/fixtures/comments/basic/sequence-expression/output.json index 751c64eda2..80389de9c3 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/sequence-expression/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/sequence-expression/output.json @@ -10,35 +10,46 @@ { "type": "ExpressionStatement", "start":8,"end":76,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":76}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 9 ", - "start":77,"end":84,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":84}} - } - ], "expression": { "type": "SequenceExpression", "start":27,"end":47,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":47}}, - "leadingComments": [ + "expressions": [ { - "type": "CommentBlock", - "value": " 2 ", - "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}} + "type": "Identifier", + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"a"}, + "name": "a", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 4 ", + "start":29,"end":36,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":36}} + } + ] }, { - "type": "CommentBlock", - "value": " 3 ", - "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}} + "type": "Identifier", + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"b"}, + "name": "b", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 6 ", + "start":48,"end":55,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":55}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 5 ", + "start":38,"end":45,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":45}} + } + ] } ], + "extra": { + "parenthesized": true, + "parenStart": 8 + }, "trailingComments": [ { "type": "CommentBlock", @@ -51,44 +62,33 @@ "start":68,"end":75,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":75}} } ], - "extra": { - "parenthesized": true, - "parenStart": 8 - }, - "expressions": [ + "leadingComments": [ { - "type": "Identifier", - "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"a"}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 4 ", - "start":29,"end":36,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":36}} - } - ], - "name": "a" + "type": "CommentBlock", + "value": " 2 ", + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}} }, { - "type": "Identifier", - "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"b"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " 5 ", - "start":38,"end":45,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":45}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 6 ", - "start":48,"end":55,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":55}} - } - ], - "name": "b" + "type": "CommentBlock", + "value": " 3 ", + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}} } ] - } + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 9 ", + "start":77,"end":84,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":84}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] @@ -140,4 +140,4 @@ "start":77,"end":84,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":84}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/surrounding-call-comments/output.json b/packages/babel-parser/test/fixtures/comments/basic/surrounding-call-comments/output.json index ba6cb1038b..b0fe8497ed 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/surrounding-call-comments/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/surrounding-call-comments/output.json @@ -35,19 +35,19 @@ }, "arguments": [] }, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " before ", - "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} - } - ], "trailingComments": [ { "type": "CommentBlock", "value": " after ", "start":47,"end":58,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " before ", + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} + } ] } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/surrounding-debugger-comments/output.json b/packages/babel-parser/test/fixtures/comments/basic/surrounding-debugger-comments/output.json index 0bb60fc14c..0c02604ac9 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/surrounding-debugger-comments/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/surrounding-debugger-comments/output.json @@ -25,19 +25,19 @@ { "type": "DebuggerStatement", "start":36,"end":45,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " before ", - "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} - } - ], "trailingComments": [ { "type": "CommentBlock", "value": " after ", "start":50,"end":61,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " before ", + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} + } ] } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/surrounding-return-comments/output.json b/packages/babel-parser/test/fixtures/comments/basic/surrounding-return-comments/output.json index 2aabdd7f5b..33cbf76237 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/surrounding-return-comments/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/surrounding-return-comments/output.json @@ -26,19 +26,19 @@ "type": "ReturnStatement", "start":36,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11}}, "argument": null, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " before ", - "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} - } - ], "trailingComments": [ { "type": "CommentBlock", "value": " after ", "start":48,"end":59,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " before ", + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} + } ] } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/surrounding-throw-comments/output.json b/packages/babel-parser/test/fixtures/comments/basic/surrounding-throw-comments/output.json index 6a9003378e..476082a119 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/surrounding-throw-comments/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/surrounding-throw-comments/output.json @@ -34,19 +34,19 @@ }, "value": 55 }, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " before ", - "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} - } - ], "trailingComments": [ { "type": "CommentBlock", "value": " after ", "start":50,"end":61,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " before ", + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} + } ] } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/surrounding-while-loop-comments/output.json b/packages/babel-parser/test/fixtures/comments/basic/surrounding-while-loop-comments/output.json index d122849e33..a12bdbef2c 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/surrounding-while-loop-comments/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/surrounding-while-loop-comments/output.json @@ -36,19 +36,19 @@ "body": [], "directives": [] }, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " infinite ", - "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}} - } - ], "trailingComments": [ { "type": "CommentBlock", "value": " bar ", "start":47,"end":56,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":56}} } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": " infinite ", + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}} + } ] }, { diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-case/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-case/output.json index cd2a5e6aef..848391260d 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-case/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-case/output.json @@ -10,21 +10,183 @@ { "type": "LabeledStatement", "start":7,"end":233,"loc":{"start":{"line":1,"column":7},"end":{"line":6,"column":3}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "-1", - "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}} - } - ], "body": { "type": "SwitchStatement", "start":25,"end":233,"loc":{"start":{"line":1,"column":25},"end":{"line":6,"column":3}}, - "leadingComments": [ + "discriminant": { + "type": "BooleanLiteral", + "start":46,"end":51,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":51}}, + "value": false, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "4", + "start":52,"end":57,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":57}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "3", + "start":40,"end":45,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":45}} + } + ] + }, + "cases": [ { - "type": "CommentBlock", - "value": "1", - "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}} + "type": "SwitchCase", + "start":78,"end":138,"loc":{"start":{"line":2,"column":10},"end":{"line":3,"column":29}}, + "consequent": [ + { + "type": "BreakStatement", + "start":113,"end":138,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":29}}, + "label": { + "type": "Identifier", + "start":126,"end":129,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":20},"identifierName":"foo"}, + "name": "foo", + "trailingComments": [ + { + "type": "CommentBlock", + "value": "11", + "start":130,"end":136,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":27}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "10", + "start":119,"end":125,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":16}} + } + ] + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "9", + "start":103,"end":108,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":40}} + } + ] + } + ], + "test": { + "type": "BooleanLiteral", + "start":89,"end":94,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":26}}, + "value": false, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "8", + "start":95,"end":100,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":32}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "7", + "start":83,"end":88,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":20}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "12", + "start":143,"end":149,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":10}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "6", + "start":72,"end":77,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}} + } + ] + }, + { + "type": "SwitchCase", + "start":150,"end":166,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":27}}, + "consequent": [], + "test": null, + "innerComments": [ + { + "type": "CommentBlock", + "value": "13", + "start":158,"end":164,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":25}} + } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": "14", + "start":167,"end":173,"loc":{"start":{"line":4,"column":28},"end":{"line":4,"column":34}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "12", + "start":143,"end":149,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":10}} + } + ] + }, + { + "type": "SwitchCase", + "start":178,"end":222,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":48}}, + "consequent": [ + { + "type": "BlockStatement", + "start":212,"end":222,"loc":{"start":{"line":5,"column":38},"end":{"line":5,"column":48}}, + "body": [], + "directives": [], + "innerComments": [ + { + "type": "CommentBlock", + "value": "18", + "start":214,"end":220,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":46}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "17", + "start":205,"end":211,"loc":{"start":{"line":5,"column":31},"end":{"line":5,"column":37}} + } + ] + } + ], + "test": { + "type": "BooleanLiteral", + "start":190,"end":195,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":21}}, + "value": false, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "16", + "start":196,"end":202,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":28}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "15", + "start":183,"end":189,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":15}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "19", + "start":223,"end":229,"loc":{"start":{"line":5,"column":49},"end":{"line":5,"column":55}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "14", + "start":167,"end":173,"loc":{"start":{"line":4,"column":28},"end":{"line":4,"column":34}} + } + ] } ], "innerComments": [ @@ -39,195 +201,33 @@ "start":60,"end":65,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":65}} } ], - "discriminant": { - "type": "BooleanLiteral", - "start":46,"end":51,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":51}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "3", - "start":40,"end":45,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":45}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "4", - "start":52,"end":57,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":57}} - } - ], - "value": false - }, - "cases": [ + "leadingComments": [ { - "type": "SwitchCase", - "start":78,"end":138,"loc":{"start":{"line":2,"column":10},"end":{"line":3,"column":29}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "6", - "start":72,"end":77,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "12", - "start":143,"end":149,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":10}} - } - ], - "consequent": [ - { - "type": "BreakStatement", - "start":113,"end":138,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":29}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "9", - "start":103,"end":108,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":40}} - } - ], - "label": { - "type": "Identifier", - "start":126,"end":129,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":20},"identifierName":"foo"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "10", - "start":119,"end":125,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":16}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "11", - "start":130,"end":136,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":27}} - } - ], - "name": "foo" - } - } - ], - "test": { - "type": "BooleanLiteral", - "start":89,"end":94,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":26}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "7", - "start":83,"end":88,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":20}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "8", - "start":95,"end":100,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":32}} - } - ], - "value": false - } - }, - { - "type": "SwitchCase", - "start":150,"end":166,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":27}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "12", - "start":143,"end":149,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":10}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "14", - "start":167,"end":173,"loc":{"start":{"line":4,"column":28},"end":{"line":4,"column":34}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": "13", - "start":158,"end":164,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":25}} - } - ], - "consequent": [], - "test": null - }, - { - "type": "SwitchCase", - "start":178,"end":222,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":48}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "14", - "start":167,"end":173,"loc":{"start":{"line":4,"column":28},"end":{"line":4,"column":34}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "19", - "start":223,"end":229,"loc":{"start":{"line":5,"column":49},"end":{"line":5,"column":55}} - } - ], - "consequent": [ - { - "type": "BlockStatement", - "start":212,"end":222,"loc":{"start":{"line":5,"column":38},"end":{"line":5,"column":48}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "17", - "start":205,"end":211,"loc":{"start":{"line":5,"column":31},"end":{"line":5,"column":37}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": "18", - "start":214,"end":220,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":46}} - } - ], - "body": [], - "directives": [] - } - ], - "test": { - "type": "BooleanLiteral", - "start":190,"end":195,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":21}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "15", - "start":183,"end":189,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":15}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "16", - "start":196,"end":202,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":28}} - } - ], - "value": false - } + "type": "CommentBlock", + "value": "1", + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}} } ] }, "label": { "type": "Identifier", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, + "name": "foo", "trailingComments": [ { "type": "CommentBlock", "value": "0", "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}} } - ], - "name": "foo" - } + ] + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "-1", + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}} + } + ] } ], "directives": [] @@ -339,4 +339,4 @@ "start":223,"end":229,"loc":{"start":{"line":5,"column":49},"end":{"line":5,"column":55}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-fallthrough-comment-in-function/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-fallthrough-comment-in-function/output.json index 208916dfa2..03f8b62b10 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-fallthrough-comment-in-function/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-fallthrough-comment-in-function/output.json @@ -50,19 +50,19 @@ }, "value": 1 }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " foo", - "start":46,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":14}} - } - ], "trailingComments": [ { "type": "CommentLine", "value": " falls through", "start":81,"end":97,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":28}} } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " foo", + "start":46,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":14}} + } ] }, { diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-fallthrough-comment/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-fallthrough-comment/output.json index fb5538434a..b0c2e2d9e5 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-fallthrough-comment/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-fallthrough-comment/output.json @@ -29,19 +29,19 @@ }, "value": 1 }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " foo", - "start":18,"end":24,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}} - } - ], "trailingComments": [ { "type": "CommentLine", "value": " falls through", "start":45,"end":61,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":24}} } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " foo", + "start":18,"end":24,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}} + } ] }, { diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon-no-default/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon-no-default/output.json index 9912ec3434..35a404dda9 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon-no-default/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon-no-default/output.json @@ -34,12 +34,12 @@ "start":27,"end":34,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11},"identifierName":"console"}, "name": "console" }, + "computed": false, "property": { "type": "Identifier", "start":35,"end":38,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":15},"identifierName":"log"}, "name": "log" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json index 5941def92e..b299254b5a 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json @@ -34,12 +34,12 @@ "start":26,"end":33,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11},"identifierName":"console"}, "name": "console" }, + "computed": false, "property": { "type": "Identifier", "start":34,"end":37,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":15},"identifierName":"log"}, "name": "log" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-no-case-comment/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-no-case-comment/output.json index 6a7bf50cc6..56c7cf323b 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-no-case-comment/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-no-case-comment/output.json @@ -10,13 +10,12 @@ { "type": "SwitchStatement", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": "3", - "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}} - } - ], + "discriminant": { + "type": "Identifier", + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"c"}, + "name": "c" + }, + "cases": [], "innerComments": [ { "type": "CommentBlock", @@ -29,12 +28,13 @@ "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}} } ], - "discriminant": { - "type": "Identifier", - "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"c"}, - "name": "c" - }, - "cases": [] + "trailingComments": [ + { + "type": "CommentBlock", + "value": "3", + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/output.json index 3255fbd32d..fb1569b162 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/output.json @@ -22,12 +22,12 @@ "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"module"}, "name": "module" }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"exports"}, "name": "exports" - }, - "computed": false + } }, "right": { "type": "FunctionExpression", @@ -78,12 +78,12 @@ "start":86,"end":90,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":20},"identifierName":"node"}, "name": "node" }, + "computed": false, "property": { "type": "Identifier", "start":91,"end":95,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":25},"identifierName":"type"}, "name": "type" - }, - "computed": false + } }, "cases": [ { @@ -113,13 +113,14 @@ "start":172,"end":176,"loc":{"start":{"line":6,"column":34},"end":{"line":6,"column":38},"identifierName":"node"}, "name": "node" }, + "computed": false, "property": { "type": "Identifier", "start":177,"end":188,"loc":{"start":{"line":6,"column":39},"end":{"line":6,"column":50},"identifierName":"expressions"}, "name": "expressions" - }, - "computed": false + } }, + "computed": true, "property": { "type": "BinaryExpression", "start":189,"end":216,"loc":{"start":{"line":6,"column":51},"end":{"line":6,"column":78}}, @@ -134,19 +135,19 @@ "start":189,"end":193,"loc":{"start":{"line":6,"column":51},"end":{"line":6,"column":55},"identifierName":"node"}, "name": "node" }, + "computed": false, "property": { "type": "Identifier", "start":194,"end":205,"loc":{"start":{"line":6,"column":56},"end":{"line":6,"column":67},"identifierName":"expressions"}, "name": "expressions" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":206,"end":212,"loc":{"start":{"line":6,"column":68},"end":{"line":6,"column":74},"identifierName":"length"}, "name": "length" - }, - "computed": false + } }, "operator": "-", "right": { @@ -158,8 +159,7 @@ }, "value": 1 } - }, - "computed": true + } } ] } diff --git a/packages/babel-parser/test/fixtures/comments/basic/try-statement/output.json b/packages/babel-parser/test/fixtures/comments/basic/try-statement/output.json index fb3ba476e0..cf5e5cb642 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/try-statement/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/try-statement/output.json @@ -10,65 +10,21 @@ { "type": "TryStatement", "start":6,"end":146,"loc":{"start":{"line":1,"column":6},"end":{"line":4,"column":34}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "1", - "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "16", - "start":147,"end":153,"loc":{"start":{"line":4,"column":35},"end":{"line":4,"column":41}} - } - ], "block": { "type": "BlockStatement", "start":16,"end":58,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":6}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "2", - "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "7", - "start":59,"end":64,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":12}} - } - ], "body": [ { "type": "ThrowStatement", "start":28,"end":51,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":33}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "3", - "start":22,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "6", - "start":52,"end":57,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}} - } - ], "argument": { "type": "StringLiteral", "start":40,"end":44,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":26}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "4", - "start":34,"end":39,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":21}} - } - ], + "extra": { + "rawValue": "no", + "raw": "\"no\"" + }, + "value": "no", "trailingComments": [ { "type": "CommentBlock", @@ -76,26 +32,95 @@ "start":45,"end":50,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":32}} } ], - "extra": { - "rawValue": "no", - "raw": "\"no\"" - }, - "value": "no" - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": "4", + "start":34,"end":39,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":21}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "6", + "start":52,"end":57,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "3", + "start":22,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}} + } + ] } ], - "directives": [] - }, - "handler": { - "type": "CatchClause", - "start":65,"end":113,"loc":{"start":{"line":3,"column":13},"end":{"line":4,"column":1}}, - "leadingComments": [ + "directives": [], + "trailingComments": [ { "type": "CommentBlock", "value": "7", "start":59,"end":64,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":12}} } ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "2", + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}} + } + ] + }, + "handler": { + "type": "CatchClause", + "start":65,"end":113,"loc":{"start":{"line":3,"column":13},"end":{"line":4,"column":1}}, + "param": { + "type": "Identifier", + "start":85,"end":86,"loc":{"start":{"line":3,"column":33},"end":{"line":3,"column":34},"identifierName":"e"}, + "name": "e", + "trailingComments": [ + { + "type": "CommentBlock", + "value": "10", + "start":87,"end":93,"loc":{"start":{"line":3,"column":35},"end":{"line":3,"column":41}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "9", + "start":79,"end":84,"loc":{"start":{"line":3,"column":27},"end":{"line":3,"column":32}} + } + ] + }, + "body": { + "type": "BlockStatement", + "start":103,"end":113,"loc":{"start":{"line":3,"column":51},"end":{"line":4,"column":1}}, + "body": [], + "directives": [], + "innerComments": [ + { + "type": "CommentBlock", + "value": "12", + "start":105,"end":111,"loc":{"start":{"line":3,"column":53},"end":{"line":3,"column":59}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "11", + "start":96,"end":102,"loc":{"start":{"line":3,"column":44},"end":{"line":3,"column":50}} + } + ] + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": "8", + "start":71,"end":76,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":24}} + } + ], "trailingComments": [ { "type": "CommentBlock", @@ -103,63 +128,19 @@ "start":114,"end":120,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":8}} } ], - "innerComments": [ + "leadingComments": [ { "type": "CommentBlock", - "value": "8", - "start":71,"end":76,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":24}} + "value": "7", + "start":59,"end":64,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":12}} } - ], - "param": { - "type": "Identifier", - "start":85,"end":86,"loc":{"start":{"line":3,"column":33},"end":{"line":3,"column":34},"identifierName":"e"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "9", - "start":79,"end":84,"loc":{"start":{"line":3,"column":27},"end":{"line":3,"column":32}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "10", - "start":87,"end":93,"loc":{"start":{"line":3,"column":35},"end":{"line":3,"column":41}} - } - ], - "name": "e" - }, - "body": { - "type": "BlockStatement", - "start":103,"end":113,"loc":{"start":{"line":3,"column":51},"end":{"line":4,"column":1}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "11", - "start":96,"end":102,"loc":{"start":{"line":3,"column":44},"end":{"line":3,"column":50}} - } - ], - "innerComments": [ - { - "type": "CommentBlock", - "value": "12", - "start":105,"end":111,"loc":{"start":{"line":3,"column":53},"end":{"line":3,"column":59}} - } - ], - "body": [], - "directives": [] - } + ] }, "finalizer": { "type": "BlockStatement", "start":136,"end":146,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":34}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "14", - "start":129,"end":135,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":23}} - } - ], + "body": [], + "directives": [], "innerComments": [ { "type": "CommentBlock", @@ -167,9 +148,28 @@ "start":138,"end":144,"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":32}} } ], - "body": [], - "directives": [] - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": "14", + "start":129,"end":135,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":23}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "16", + "start":147,"end":153,"loc":{"start":{"line":4,"column":35},"end":{"line":4,"column":41}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "1", + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/comments/regression/10432/output.json b/packages/babel-parser/test/fixtures/comments/regression/10432/output.json index c0e2eb4b67..61a596bdc9 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/10432/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/10432/output.json @@ -60,12 +60,12 @@ "start":64,"end":70,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":6},"identifierName":"socket"}, "name": "socket" }, + "computed": false, "property": { "type": "Identifier", "start":71,"end":73,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9},"identifierName":"on"}, "name": "on" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/comments/regression/11469/output.json b/packages/babel-parser/test/fixtures/comments/regression/11469/output.json index c926a81919..bc3d0bec24 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/11469/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/11469/output.json @@ -174,4 +174,4 @@ "start":166,"end":191,"loc":{"start":{"line":17,"column":2},"end":{"line":17,"column":27}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json index b7ad657038..bb9c624d13 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json @@ -20,10 +20,6 @@ "left": { "type": "AssignmentPattern", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "left": { "type": "Identifier", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, @@ -34,6 +30,10 @@ "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, "value": 1, "raw": "1" + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json index 513534989f..02696a582b 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json @@ -24,10 +24,6 @@ { "type": "AssignmentPattern", "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, - "extra": { - "parenthesized": true, - "parenStart": 1 - }, "left": { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, @@ -38,6 +34,10 @@ "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "value": 1, "raw": "1" + }, + "extra": { + "parenthesized": true, + "parenStart": 1 } } ] diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json index 3e16332777..b389b41716 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json @@ -24,10 +24,6 @@ { "type": "ObjectPattern", "start":2,"end":15,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":15}}, - "extra": { - "parenthesized": true, - "parenStart": 1 - }, "properties": [ { "type": "Property", @@ -63,7 +59,11 @@ }, "kind": "init" } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 1 + } } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json index 786558b49e..ba627e1205 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json @@ -43,10 +43,6 @@ { "type": "ArrayPattern", "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "elements": [ { "type": "AssignmentPattern", @@ -63,7 +59,11 @@ "raw": "1" } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json index 4c6ed5aea6..c38d43a2c5 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json @@ -24,17 +24,17 @@ { "type": "ArrayPattern", "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, - "extra": { - "parenthesized": true, - "parenStart": 1 - }, "elements": [ { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 1 + } } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/not-directive/output.json b/packages/babel-parser/test/fixtures/core/categorized/not-directive/output.json index 507489c6bc..3aa11d6b17 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/not-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/not-directive/output.json @@ -37,12 +37,12 @@ }, "value": "use strict" }, + "computed": false, "property": { "type": "Identifier", "start":30,"end":33,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":16},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } } }, { @@ -60,12 +60,12 @@ }, "value": "use strict" }, + "computed": true, "property": { "type": "Identifier", "start":48,"end":51,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":16},"identifierName":"foo"}, "name": "foo" - }, - "computed": true + } } }, { @@ -140,12 +140,12 @@ }, "value": "use strict" }, + "computed": false, "property": { "type": "Identifier", "start":108,"end":111,"loc":{"start":{"line":8,"column":3},"end":{"line":8,"column":6},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } } }, { @@ -163,12 +163,12 @@ }, "value": "use strict" }, + "computed": true, "property": { "type": "Identifier", "start":129,"end":132,"loc":{"start":{"line":10,"column":3},"end":{"line":10,"column":6},"identifierName":"foo"}, "name": "foo" - }, - "computed": true + } } }, { @@ -285,12 +285,12 @@ }, "value": "use strict" }, + "computed": false, "property": { "type": "Identifier", "start":293,"end":296,"loc":{"start":{"line":20,"column":15},"end":{"line":20,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } } }, { @@ -340,12 +340,12 @@ }, "value": "use strict" }, + "computed": true, "property": { "type": "Identifier", "start":338,"end":341,"loc":{"start":{"line":25,"column":15},"end":{"line":25,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "computed": true + } } }, { @@ -516,12 +516,12 @@ }, "value": "use strict" }, + "computed": false, "property": { "type": "Identifier", "start":479,"end":482,"loc":{"start":{"line":41,"column":3},"end":{"line":41,"column":6},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } } }, { @@ -571,12 +571,12 @@ }, "value": "use strict" }, + "computed": true, "property": { "type": "Identifier", "start":527,"end":530,"loc":{"start":{"line":47,"column":3},"end":{"line":47,"column":6},"identifierName":"foo"}, "name": "foo" - }, - "computed": true + } } }, { @@ -761,12 +761,12 @@ }, "value": "use strict" }, + "computed": false, "property": { "type": "Identifier", "start":680,"end":683,"loc":{"start":{"line":65,"column":15},"end":{"line":65,"column":18},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } } }, { @@ -830,12 +830,12 @@ }, "value": "use strict" }, + "computed": true, "property": { "type": "Identifier", "start":734,"end":737,"loc":{"start":{"line":71,"column":15},"end":{"line":71,"column":18},"identifierName":"bar"}, "name": "bar" - }, - "computed": true + } } }, { @@ -1048,12 +1048,12 @@ }, "value": "use strict" }, + "computed": false, "property": { "type": "Identifier", "start":902,"end":905,"loc":{"start":{"line":90,"column":3},"end":{"line":90,"column":6},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } } }, { @@ -1117,12 +1117,12 @@ }, "value": "use strict" }, + "computed": true, "property": { "type": "Identifier", "start":959,"end":962,"loc":{"start":{"line":97,"column":3},"end":{"line":97,"column":6},"identifierName":"bar"}, "name": "bar" - }, - "computed": true + } } }, { diff --git a/packages/babel-parser/test/fixtures/core/categorized/sequence-expression-end/output.json b/packages/babel-parser/test/fixtures/core/categorized/sequence-expression-end/output.json index 8db0508b75..bf55202714 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/sequence-expression-end/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/sequence-expression-end/output.json @@ -44,4 +44,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/output.json b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/output.json index 1285d54959..7646dff545 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/output.json @@ -26,12 +26,12 @@ "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, - "computed": false, "extra": { "parenthesized": true, "parenStart": 1 diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/output.json index a88afdae43..988288a32f 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/output.json @@ -27,9 +27,6 @@ { "type": "ObjectProperty", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -42,6 +39,9 @@ "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"x"}, "name": "x" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-member-expression/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-member-expression/output.json index 1318e397e3..76feb36376 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-member-expression/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-member-expression/output.json @@ -29,12 +29,12 @@ "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" - }, - "computed": false + } } } ] diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json index f398774dcc..64ef8c6976 100644 --- a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json @@ -29,9 +29,6 @@ { "type": "ObjectProperty", "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -44,6 +41,9 @@ "type": "Identifier", "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"break"}, "name": "break" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json index 7d3eaf581e..6e012093cc 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json @@ -38,8 +38,8 @@ "type": "DirectiveLiteral", "start":17,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "extra": { - "raw": "\"\\5\"", - "rawValue": "\\5" + "rawValue": "\\5", + "raw": "\"\\5\"" }, "value": "\\5" } @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":25,"end":37,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -83,8 +83,8 @@ "type": "DirectiveLiteral", "start":59,"end":63,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":6}}, "extra": { - "raw": "\"\\4\"", - "rawValue": "\\4" + "rawValue": "\\4", + "raw": "\"\\4\"" }, "value": "\\4" } @@ -96,8 +96,8 @@ "type": "DirectiveLiteral", "start":67,"end":71,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":6}}, "extra": { - "raw": "\"\\5\"", - "rawValue": "\\5" + "rawValue": "\\5", + "raw": "\"\\5\"" }, "value": "\\5" } @@ -109,8 +109,8 @@ "type": "DirectiveLiteral", "start":75,"end":87,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -141,8 +141,8 @@ "type": "DirectiveLiteral", "start":109,"end":121,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -154,8 +154,8 @@ "type": "DirectiveLiteral", "start":125,"end":129,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":6}}, "extra": { - "raw": "\"\\5\"", - "rawValue": "\\5" + "rawValue": "\\5", + "raw": "\"\\5\"" }, "value": "\\5" } @@ -186,8 +186,8 @@ "type": "DirectiveLiteral", "start":151,"end":163,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -199,8 +199,8 @@ "type": "DirectiveLiteral", "start":167,"end":171,"loc":{"start":{"line":19,"column":2},"end":{"line":19,"column":6}}, "extra": { - "raw": "\"\\4\"", - "rawValue": "\\4" + "rawValue": "\\4", + "raw": "\"\\4\"" }, "value": "\\4" } @@ -212,8 +212,8 @@ "type": "DirectiveLiteral", "start":175,"end":179,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":6}}, "extra": { - "raw": "\"\\5\"", - "rawValue": "\\5" + "rawValue": "\\5", + "raw": "\"\\5\"" }, "value": "\\5" } diff --git a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json index 1d7dc7c699..9ce11fe018 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json @@ -27,8 +27,8 @@ "type": "DirectiveLiteral", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "extra": { - "raw": "\"\\01 foo \\02 bar \\03\"", - "rawValue": "\\01 foo \\02 bar \\03" + "rawValue": "\\01 foo \\02 bar \\03", + "raw": "\"\\01 foo \\02 bar \\03\"" }, "value": "\\01 foo \\02 bar \\03" } @@ -40,8 +40,8 @@ "type": "DirectiveLiteral", "start":24,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4}}, "extra": { - "raw": "\"\\4\"", - "rawValue": "\\4" + "rawValue": "\\4", + "raw": "\"\\4\"" }, "value": "\\4" } @@ -53,8 +53,8 @@ "type": "DirectiveLiteral", "start":30,"end":34,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":4}}, "extra": { - "raw": "\"\\5\"", - "rawValue": "\\5" + "rawValue": "\\5", + "raw": "\"\\5\"" }, "value": "\\5" } @@ -66,8 +66,8 @@ "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -79,8 +79,8 @@ "type": "DirectiveLiteral", "start":52,"end":56,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":4}}, "extra": { - "raw": "\"\\4\"", - "rawValue": "\\4" + "rawValue": "\\4", + "raw": "\"\\4\"" }, "value": "\\4" } @@ -92,8 +92,8 @@ "type": "DirectiveLiteral", "start":58,"end":62,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":4}}, "extra": { - "raw": "\"\\5\"", - "rawValue": "\\5" + "rawValue": "\\5", + "raw": "\"\\5\"" }, "value": "\\5" } @@ -105,8 +105,8 @@ "type": "DirectiveLiteral", "start":65,"end":86,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":21}}, "extra": { - "raw": "\"\\04 foo \\05 bar \\06\"", - "rawValue": "\\04 foo \\05 bar \\06" + "rawValue": "\\04 foo \\05 bar \\06", + "raw": "\"\\04 foo \\05 bar \\06\"" }, "value": "\\04 foo \\05 bar \\06" } diff --git a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json index 4f5808019d..fa4dcfc2cf 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json @@ -35,8 +35,8 @@ "type": "DirectiveLiteral", "start":10,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "extra": { - "raw": "\"\\8\"", - "rawValue": "\\8" + "rawValue": "\\8", + "raw": "\"\\8\"" }, "value": "\\8" } @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":15,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11}}, "extra": { - "raw": "\"\\9\"", - "rawValue": "\\9" + "rawValue": "\\9", + "raw": "\"\\9\"" }, "value": "\\9" } @@ -61,8 +61,8 @@ "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -74,8 +74,8 @@ "type": "DirectiveLiteral", "start":39,"end":43,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":6}}, "extra": { - "raw": "\"\\8\"", - "rawValue": "\\8" + "rawValue": "\\8", + "raw": "\"\\8\"" }, "value": "\\8" } @@ -87,8 +87,8 @@ "type": "DirectiveLiteral", "start":44,"end":48,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":11}}, "extra": { - "raw": "\"\\9\"", - "rawValue": "\\9" + "rawValue": "\\9", + "raw": "\"\\9\"" }, "value": "\\9" } diff --git a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json index 57c9d57144..b597cdca49 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":37,"end":41,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":6}}, "extra": { - "raw": "\"\\8\"", - "rawValue": "\\8" + "rawValue": "\\8", + "raw": "\"\\8\"" }, "value": "\\8" } @@ -59,8 +59,8 @@ "type": "DirectiveLiteral", "start":42,"end":46,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":11}}, "extra": { - "raw": "\"\\9\"", - "rawValue": "\\9" + "rawValue": "\\9", + "raw": "\"\\9\"" }, "value": "\\9" } @@ -78,8 +78,8 @@ "type": "DirectiveLiteral", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { - "raw": "\"\\8\"", - "rawValue": "\\8" + "rawValue": "\\8", + "raw": "\"\\8\"" }, "value": "\\8" } @@ -91,8 +91,8 @@ "type": "DirectiveLiteral", "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "extra": { - "raw": "\"\\9\"", - "rawValue": "\\9" + "rawValue": "\\9", + "raw": "\"\\9\"" }, "value": "\\9" } diff --git a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json index 6a534cbb80..23953fa175 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":52,"end":71,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":71}}, "extra": { - "raw": "\"octal directive\\1\"", - "rawValue": "octal directive\\1" + "rawValue": "octal directive\\1", + "raw": "\"octal directive\\1\"" }, "value": "octal directive\\1" } @@ -66,8 +66,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json index 2be4810dff..4115ea4e32 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, - "extra": { - "parenthesized": true, - "parenStart": 33 - }, "properties": [ { "type": "ObjectProperty", @@ -61,7 +57,11 @@ "value": 42 } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 33 + } } } ], @@ -73,8 +73,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json index fcc351cc30..37d3bc6fbc 100644 --- a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json +++ b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -108,8 +108,8 @@ "type": "DirectiveLiteral", "start":57,"end":69,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json index 081d0f0262..d5d073c19a 100644 --- a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json +++ b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json b/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json index 249b267a31..834eca6a91 100644 --- a/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json +++ b/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", @@ -43,7 +39,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/object/member-expression-after-property-initializer-1/output.json b/packages/babel-parser/test/fixtures/core/object/member-expression-after-property-initializer-1/output.json index a3fd8b4143..6fe315c21c 100644 --- a/packages/babel-parser/test/fixtures/core/object/member-expression-after-property-initializer-1/output.json +++ b/packages/babel-parser/test/fixtures/core/object/member-expression-after-property-initializer-1/output.json @@ -70,12 +70,12 @@ "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17},"identifierName":"test"}, "name": "test" }, + "computed": false, "property": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"d"}, "name": "d" - }, - "computed": false + } } } ] diff --git a/packages/babel-parser/test/fixtures/core/object/member-expression-after-property-initializer-2/output.json b/packages/babel-parser/test/fixtures/core/object/member-expression-after-property-initializer-2/output.json index 11c1977bfa..d9143a2cc8 100644 --- a/packages/babel-parser/test/fixtures/core/object/member-expression-after-property-initializer-2/output.json +++ b/packages/babel-parser/test/fixtures/core/object/member-expression-after-property-initializer-2/output.json @@ -70,12 +70,12 @@ "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "properties": [] }, + "computed": false, "property": { "type": "Identifier", "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"d"}, "name": "d" - }, - "computed": false + } } } ] diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json index 5cb36b70a8..ed10aa4354 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json @@ -29,9 +29,6 @@ { "type": "ObjectProperty", "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -44,6 +41,9 @@ "type": "Identifier", "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/import-meta/output.json b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/import-meta/output.json index 62a3a56107..0180312732 100644 --- a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/import-meta/output.json +++ b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/import-meta/output.json @@ -21,12 +21,12 @@ "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"console"}, "name": "console" }, + "computed": false, "property": { "type": "Identifier", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"log"}, "name": "log" - }, - "computed": false + } }, "arguments": [ { @@ -49,4 +49,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/100/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/100/output.json index 8bbf441a1b..dbf4039b4e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/100/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/100/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, - "value": "Hello\\\nworld", "extra": { - "raw": "\"Hello\\\nworld\"", - "rawValue": "Hello\\\nworld" - } + "rawValue": "Hello\\\nworld", + "raw": "\"Hello\\\nworld\"" + }, + "value": "Hello\\\nworld" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/101/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/101/output.json index b34917f7e6..480d402ced 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/101/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/101/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, - "value": "Hello\\1World", "extra": { - "raw": "\"Hello\\1World\"", - "rawValue": "Hello\\1World" - } + "rawValue": "Hello\\1World", + "raw": "\"Hello\\1World\"" + }, + "value": "Hello\\1World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/113/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/113/output.json index 6b3dccf75c..42c4d64597 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/113/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/113/output.json @@ -26,12 +26,12 @@ }, "arguments": [] }, + "computed": false, "property": { "type": "Identifier", "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/114/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/114/output.json index 2a3507d72d..b044f76b67 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/114/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/114/output.json @@ -21,12 +21,12 @@ "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"foo"}, "name": "foo" }, + "computed": true, "property": { "type": "Identifier", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"bar"}, "name": "bar" - }, - "computed": true + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/115/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/115/output.json index 3a2644e842..2fed161803 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/115/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/115/output.json @@ -21,12 +21,12 @@ "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/116/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/116/output.json index 6dfef381ed..01c6ae642b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/116/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/116/output.json @@ -30,12 +30,12 @@ "parenStart": 0 } }, + "computed": false, "property": { "type": "Identifier", "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/119/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/119/output.json index d55ddd1b61..d99247274c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/119/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/119/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/120/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/120/output.json index 90f241ea29..604e12fc91 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/120/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/120/output.json @@ -21,19 +21,19 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29},"identifierName":"solarsystem"}, "name": "solarsystem" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/121/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/121/output.json index 6ebb1a398b..3477033dd2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/121/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/121/output.json @@ -24,26 +24,26 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29},"identifierName":"solarsystem"}, "name": "solarsystem" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35},"identifierName":"Earth"}, "name": "Earth" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/122/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/122/output.json index 35c3eaa5e2..f1c92b7513 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/122/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/122/output.json @@ -18,6 +18,7 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "SequenceExpression", "start":9,"end":37,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":37}}, @@ -33,8 +34,7 @@ "name": "otherUselessName" } ] - }, - "computed": true + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/123/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/123/output.json index 5ccfa4a76d..983fdcfeb5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/123/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/123/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "Identifier", "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19},"identifierName":"galaxyName"}, "name": "galaxyName" - }, - "computed": true + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/124/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/124/output.json index 5fa10d856c..a82eeff097 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/124/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/124/output.json @@ -21,6 +21,7 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "NumericLiteral", "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11}}, @@ -29,15 +30,14 @@ "raw": "42" }, "value": 42 - }, - "computed": true + } }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/125/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/125/output.json index 5fe9e49343..c9f3852442 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/125/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/125/output.json @@ -33,12 +33,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/126/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/126/output.json index e7068fd5ca..cb29e5cc68 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/126/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/126/output.json @@ -39,12 +39,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } }, "arguments": [ { @@ -76,12 +76,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/127/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/127/output.json index 645ac82f55..8c03d9bd93 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/127/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/127/output.json @@ -27,26 +27,26 @@ "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"earth"}, "name": "earth" }, + "computed": false, "property": { "type": "Identifier", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"asia"}, "name": "asia" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20},"identifierName":"Indonesia"}, "name": "Indonesia" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":21,"end":39,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":39},"identifierName":"prepareForElection"}, "name": "prepareForElection" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/128/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/128/output.json index 96d56d51f4..b24e188c0f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/128/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/128/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"if"}, "name": "if" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/129/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/129/output.json index 834a12a4eb..3f833a43ea 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/129/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/129/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"true"}, "name": "true" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/130/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/130/output.json index e7664cfc93..b6c5210d83 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/130/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/130/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"false"}, "name": "false" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/131/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/131/output.json index d9b4c0dd9e..e5ee7189d7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/131/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/131/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"null"}, "name": "null" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/263/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/263/output.json index ccc3410c91..42e73869f6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/263/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/263/output.json @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, - "value": "use\\x20strict", "extra": { - "raw": "'use\\x20strict'", - "rawValue": "use\\x20strict" - } + "rawValue": "use\\x20strict", + "raw": "'use\\x20strict'" + }, + "value": "use\\x20strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/264/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/264/output.json index 10bfd0ed11..7c10e41070 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/264/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/264/output.json @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, - "value": "use\\x20strict", "extra": { - "raw": "\"use\\x20strict\"", - "rawValue": "use\\x20strict" - } + "rawValue": "use\\x20strict", + "raw": "\"use\\x20strict\"" + }, + "value": "use\\x20strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/289/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/289/output.json index 68368affc1..364603e3a7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/289/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/289/output.json @@ -44,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":49}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/318/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/318/output.json index 07b0ebfb1a..b3549ca48a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/318/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/318/output.json @@ -31,11 +31,11 @@ "value": { "type": "DirectiveLiteral", "start":16,"end":28,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":13}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" } }, { @@ -44,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":31,"end":34,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":4}}, - "value": "\u0000", "extra": { - "raw": "'\u0000'", - "rawValue": "\u0000" - } + "rawValue": "\u0000", + "raw": "'\u0000'" + }, + "value": "\u0000" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/319/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/319/output.json index 0652e0f830..3c3473593d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/319/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/319/output.json @@ -25,12 +25,12 @@ }, "value": 123 }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13},"identifierName":"toString"}, "name": "toString" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/322/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/322/output.json index 86a454183f..142f4d718e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/322/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/322/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, - "value": "a\\u0026b", "extra": { - "raw": "'a\\u0026b'", - "rawValue": "a\\u0026b" - } + "rawValue": "a\\u0026b", + "raw": "'a\\u0026b'" + }, + "value": "a\\u0026b" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/326/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/326/output.json index f86ce18fe5..9e1794cfaa 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/326/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/326/output.json @@ -21,12 +21,12 @@ "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":2,"end":4,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":4},"identifierName":"in"}, "name": "in" - }, - "computed": false + } }, "operator": "/", "right": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/340/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/340/output.json index 57a5959b41..d7283296e7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/340/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/340/output.json @@ -18,12 +18,12 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"in"}, "name": "in" - }, - "computed": false + } } }, { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/342/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/342/output.json index ec31bddc3a..88150055b9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/342/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/342/output.json @@ -16,14 +16,14 @@ "left": { "type": "Identifier", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, + "name": "foo", "trailingComments": [ { "type": "CommentLine", "value": "bar", "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11}} } - ], - "name": "foo" + ] }, "operator": "+", "right": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/344/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/344/output.json index faed8b5020..eb9158aafb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/344/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/344/output.json @@ -21,12 +21,12 @@ "start":14,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6},"identifierName":"object"}, "name": "object" }, + "computed": false, "property": { "type": "Identifier", "start":21,"end":27,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":13},"identifierName":"static"}, "name": "static" - }, - "computed": false + } }, "arguments": [] } @@ -39,11 +39,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json index 66b1f9ca63..72cdf26d30 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json @@ -21,10 +21,6 @@ "left": { "type": "BinaryExpression", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "left": { "type": "NumericLiteral", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, @@ -43,6 +39,10 @@ "raw": "1" }, "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json index ce1ff12dc0..15e8b8ebdb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json @@ -17,10 +17,6 @@ "left": { "type": "BinaryExpression", "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, - "extra": { - "parenthesized": true, - "parenStart": 4 - }, "left": { "type": "NumericLiteral", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, @@ -39,6 +35,10 @@ "raw": "1" }, "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 4 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json index fa61b279c3..29ecc31971 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":19,"end":43,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":43}}, - "extra": { - "parenthesized": true, - "parenStart": 18 - }, "id": null, "generator": false, "async": false, @@ -54,6 +50,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json index 4390beac20..037c5e6826 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":19,"end":46,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":46}}, - "extra": { - "parenthesized": true, - "parenStart": 18 - }, "id": null, "generator": false, "async": false, @@ -54,6 +50,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json index 4a682d6c85..e16e8f8d1b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, - "extra": { - "parenthesized": true, - "parenStart": 18 - }, "id": null, "generator": false, "async": false, @@ -50,6 +46,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json index 9321eacbd5..5ad5e3a253 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, - "extra": { - "parenthesized": true, - "parenStart": 18 - }, "id": null, "generator": false, "async": false, @@ -50,6 +46,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json index 4eac4215e0..ec18a41c15 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json @@ -16,10 +16,6 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -55,8 +51,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } @@ -64,7 +60,11 @@ ] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json index 224e3d31eb..6e50ea1697 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json @@ -16,10 +16,6 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -53,8 +49,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } @@ -62,7 +58,11 @@ ] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json index 067b73ce53..5824ea0f73 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json @@ -59,8 +59,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json index 2d7204637a..bf1c3390af 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json @@ -59,8 +59,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json index 44484811f9..fe50f66a91 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json index dca567981b..5ec5d95b40 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json index 3338052138..932ad53e37 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json @@ -57,8 +57,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json index 3d1c7d7ebe..39f80928a3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json @@ -57,8 +57,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json index 5593bc5e19..941f1562ef 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json index 6b15ccd03e..fbcef97a83 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json index 35025e0c60..467e17681b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json index 5bead73e79..1c81cb944a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json index 0b82488fd4..9910fc4ca6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json index 9bbefb53c9..64880bbf36 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json index 58d6e13320..33e66b8292 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json index 0a859a25f4..daba68f0a5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json index eacc05a4b0..27de7209a4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json @@ -52,8 +52,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json index 4fc4cfff5a..e3aaac026b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json @@ -52,8 +52,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json index fdc46d061d..2124c31099 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json index 7b1924caf1..7aef7b58af 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json index 48f9179f3b..d8d9a87930 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json @@ -31,10 +31,6 @@ "expression": { "type": "CallExpression", "start":33,"end":54,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":54}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "callee": { "type": "FunctionExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, @@ -53,7 +49,11 @@ "directives": [] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -65,8 +65,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json index 2d2f562d54..ef5dbc5819 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json @@ -31,10 +31,6 @@ "expression": { "type": "CallExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "callee": { "type": "FunctionExpression", "start":33,"end":57,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":57}}, @@ -53,7 +49,11 @@ "directives": [] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -65,8 +65,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json index 3c81b46822..835ee6d57f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json @@ -19,10 +19,6 @@ "callee": { "type": "FunctionExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"eval"}, @@ -43,13 +39,17 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json index 8e6c5c8943..e6673306c5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json @@ -19,10 +19,6 @@ "callee": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19},"identifierName":"arguments"}, @@ -43,13 +39,17 @@ "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json index 9229db313a..266ef0cac8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectProperty", @@ -66,7 +62,11 @@ } } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -78,8 +78,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json index c5b8877683..b3267927ce 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json @@ -19,10 +19,6 @@ "callee": { "type": "FunctionExpression", "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"package"}, @@ -43,13 +39,17 @@ "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json index 47a65a4a93..c0979c1242 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectProperty", @@ -85,7 +81,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -97,8 +97,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json index 6f387fb201..97e2668793 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectMethod", @@ -64,7 +60,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -76,8 +76,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json index 68a903fb4f..41b12f57d7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectProperty", @@ -72,7 +68,11 @@ } } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -84,8 +84,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json index 830edc82be..13972980b5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json index 232a3d3612..4e56622edb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json index 9b32d2b448..19787e26dd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json @@ -58,8 +58,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json index 7395b0a56a..f0a5a4d594 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json @@ -58,8 +58,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json index dab3473097..1256393ff4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json @@ -47,8 +47,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json index 7e92eeb15f..46c2311222 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":34,"end":45,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":45}}, - "extra": { - "parenthesized": true, - "parenStart": 33 - }, "properties": [ { "type": "ObjectProperty", @@ -61,7 +57,11 @@ "value": 42 } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 33 + } } } ], @@ -73,8 +73,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json index 917c3e5a9e..81d51ffb9b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json index 98446531fa..6c46ff6503 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json index 4e1da8899d..f529b5daa3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json index 52b9164d1a..a6575e03a7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json index f7dbc7b74c..32835a520f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json index 5e4ded19fd..469235ed6d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json index 70f7e9670e..2a50605954 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json index fda02a2a3f..6cd9d958c9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json index 7f3b58f78a..12d7c32962 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json index 7feccdb115..1446d4a778 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json @@ -37,8 +37,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json index 3fba35b99d..3ae2bbc039 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json @@ -44,8 +44,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json index 55829c2b07..a9aed7a2dc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json index b82f2cea47..a84cfbde62 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json index 8cf993f513..8d6fb36639 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json @@ -67,8 +67,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json index 8f987f7098..345cb14aa3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -51,13 +47,17 @@ "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json index 688a01f586..097067ec9f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, - "extra": { - "parenthesized": true, - "parenStart": 29 - }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"b"}, @@ -59,6 +55,10 @@ "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 29 } } } @@ -71,8 +71,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json index 911fe15b76..d31f179278 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -46,13 +42,17 @@ "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json index 44b440b91f..5f7a585303 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -46,13 +42,17 @@ "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json index f55a1a9f98..4eb007c052 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":28,"end":40,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":40}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -95,8 +95,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/539/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/539/output.json index 09dfa53195..db2cc5ad01 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/539/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/539/output.json @@ -35,11 +35,11 @@ "value": { "type": "DirectiveLiteral", "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/542/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/542/output.json index 9cbc40e7c5..bd41bfbf3e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/542/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/542/output.json @@ -25,12 +25,12 @@ }, "value": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":12,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":6},"identifierName":"split"}, "name": "split" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/543/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/543/output.json index 0a23440389..b4d912e792 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/543/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/543/output.json @@ -37,11 +37,11 @@ "value": { "type": "DirectiveLiteral", "start":25,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } }, { @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":41,"end":53,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json index 6200ad3f14..96424f80de 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json @@ -24,9 +24,6 @@ { "type": "ObjectProperty", "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -39,6 +36,9 @@ "type": "Identifier", "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"public"}, "name": "public" + }, + "extra": { + "shorthand": true } } ] @@ -66,8 +66,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json index 7227f3e875..ee27abd630 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json @@ -24,9 +24,6 @@ { "type": "ObjectProperty", "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -39,6 +36,9 @@ "type": "Identifier", "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"public"}, "name": "public" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json index 81e80a03d4..b38e05a9ce 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json @@ -44,8 +44,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json index f6c6e7c58b..66cbe590eb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json @@ -44,8 +44,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/85/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/85/output.json index 06adbec3fd..b21a141016 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/85/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/85/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, - "value": "Hello", "extra": { - "raw": "\"Hello\"", - "rawValue": "Hello" - } + "rawValue": "Hello", + "raw": "\"Hello\"" + }, + "value": "Hello" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/86/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/86/output.json index 85beda94d4..efadaa1833 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/86/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/86/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, - "value": "\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0", "extra": { - "raw": "\"\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0\"", - "rawValue": "\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0" - } + "rawValue": "\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0", + "raw": "\"\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0\"" + }, + "value": "\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/87/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/87/output.json index eaa53e6030..05d1a81000 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/87/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/87/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, - "value": "\\u0061", "extra": { - "raw": "\"\\u0061\"", - "rawValue": "\\u0061" - } + "rawValue": "\\u0061", + "raw": "\"\\u0061\"" + }, + "value": "\\u0061" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/88/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/88/output.json index fb5e0996bf..54cc770503 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/88/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/88/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "value": "\\x61", "extra": { - "raw": "\"\\x61\"", - "rawValue": "\\x61" - } + "rawValue": "\\x61", + "raw": "\"\\x61\"" + }, + "value": "\\x61" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/89/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/89/output.json index 2bc5cf54b2..161f9e44f7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/89/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/89/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, - "value": "Hello\\nworld", "extra": { - "raw": "\"Hello\\nworld\"", - "rawValue": "Hello\\nworld" - } + "rawValue": "Hello\\nworld", + "raw": "\"Hello\\nworld\"" + }, + "value": "Hello\\nworld" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/90/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/90/output.json index 8bbf441a1b..dbf4039b4e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/90/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/90/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, - "value": "Hello\\\nworld", "extra": { - "raw": "\"Hello\\\nworld\"", - "rawValue": "Hello\\\nworld" - } + "rawValue": "Hello\\\nworld", + "raw": "\"Hello\\\nworld\"" + }, + "value": "Hello\\\nworld" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/91/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/91/output.json index 7ba45ecc53..96777bab48 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/91/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/91/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, - "value": "Hello\\02World", "extra": { - "raw": "\"Hello\\02World\"", - "rawValue": "Hello\\02World" - } + "rawValue": "Hello\\02World", + "raw": "\"Hello\\02World\"" + }, + "value": "Hello\\02World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/92/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/92/output.json index 6ff8b0773c..aed791b605 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/92/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/92/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\012World", "extra": { - "raw": "\"Hello\\012World\"", - "rawValue": "Hello\\012World" - } + "rawValue": "Hello\\012World", + "raw": "\"Hello\\012World\"" + }, + "value": "Hello\\012World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/93/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/93/output.json index 43e794894e..5006e83a10 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/93/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/93/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\122World", "extra": { - "raw": "\"Hello\\122World\"", - "rawValue": "Hello\\122World" - } + "rawValue": "Hello\\122World", + "raw": "\"Hello\\122World\"" + }, + "value": "Hello\\122World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/94/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/94/output.json index e51d6f3e51..3262f09149 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/94/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/94/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, - "value": "Hello\\0122World", "extra": { - "raw": "\"Hello\\0122World\"", - "rawValue": "Hello\\0122World" - } + "rawValue": "Hello\\0122World", + "raw": "\"Hello\\0122World\"" + }, + "value": "Hello\\0122World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/95/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/95/output.json index 4dfa59a362..7b741d3ad0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/95/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/95/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\312World", "extra": { - "raw": "\"Hello\\312World\"", - "rawValue": "Hello\\312World" - } + "rawValue": "Hello\\312World", + "raw": "\"Hello\\312World\"" + }, + "value": "Hello\\312World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/96/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/96/output.json index f7c0c7ae2f..be48a13c15 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/96/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/96/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\412World", "extra": { - "raw": "\"Hello\\412World\"", - "rawValue": "Hello\\412World" - } + "rawValue": "Hello\\412World", + "raw": "\"Hello\\412World\"" + }, + "value": "Hello\\412World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/97/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/97/output.json index dc27abbc37..d5ff7f4e92 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/97/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/97/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\812World", "extra": { - "raw": "\"Hello\\812World\"", - "rawValue": "Hello\\812World" - } + "rawValue": "Hello\\812World", + "raw": "\"Hello\\812World\"" + }, + "value": "Hello\\812World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/98/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/98/output.json index 7ceb0644f6..a384cdbfcd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/98/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/98/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\712World", "extra": { - "raw": "\"Hello\\712World\"", - "rawValue": "Hello\\712World" - } + "rawValue": "Hello\\712World", + "raw": "\"Hello\\712World\"" + }, + "value": "Hello\\712World" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/99/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/99/output.json index 1a8fc198f2..bea9ab356e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/99/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/99/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, - "value": "Hello\\0World", "extra": { - "raw": "\"Hello\\0World\"", - "rawValue": "Hello\\0World" - } + "rawValue": "Hello\\0World", + "raw": "\"Hello\\0World\"" + }, + "value": "Hello\\0World" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json index 4e59252097..bcbc0775f4 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json @@ -28,11 +28,11 @@ { "type": "Identifier", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"b"}, + "name": "b", "extra": { "parenthesized": true, "parenStart": 4 - }, - "name": "b" + } } ], "body": { diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json index cc46874cf7..db986351a1 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json @@ -37,11 +37,11 @@ { "type": "Identifier", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 4 - }, - "name": "a" + } } ] }, diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json index 23c45add44..a4ac1437cf 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json @@ -33,11 +33,11 @@ "left": { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 2 - }, - "name": "a" + } }, "right": { "type": "ArrayExpression", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json index 8d6e26697a..c692779fa8 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json @@ -27,11 +27,11 @@ { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 2 - }, - "name": "a" + } } ] } diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json index 89f11f8853..bdb0b9c612 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json @@ -41,10 +41,6 @@ "value": { "type": "MemberExpression", "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "object": { "type": "Identifier", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, @@ -55,6 +51,10 @@ "type": "Identifier", "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"qux"}, "name": "qux" + }, + "extra": { + "parenthesized": true, + "parenStart": 6 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json index a33f06e060..0d79a28f04 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json @@ -41,11 +41,11 @@ "value": { "type": "Identifier", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 6 - }, - "name": "foo" + } } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json index afde07cd68..d124165b00 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json @@ -32,11 +32,11 @@ { "type": "Identifier", "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 11 - }, - "name": "foo" + } } ], "body": { diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/parenthesized-lhs-in-parethesis-in-param/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/parenthesized-lhs-in-parethesis-in-param/output.json index 6626adc706..b7c51a6815 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/parenthesized-lhs-in-parethesis-in-param/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/parenthesized-lhs-in-parethesis-in-param/output.json @@ -28,10 +28,6 @@ "right": { "type": "AssignmentExpression", "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "operator": "=", "left": { "type": "ArrayPattern", @@ -43,11 +39,11 @@ "left": { "type": "Identifier", "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"f"}, + "name": "f", "extra": { "parenthesized": true, "parenStart": 7 - }, - "name": "f" + } }, "right": { "type": "ArrayExpression", @@ -61,6 +57,10 @@ "type": "ArrayExpression", "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "elements": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json index 49c4af0699..a9c07e17b5 100644 --- a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json @@ -21,10 +21,6 @@ "superClass": { "type": "CallExpression", "start":17,"end":60,"loc":{"start":{"line":1,"column":17},"end":{"line":4,"column":3}}, - "extra": { - "parenthesized": true, - "parenStart": 16 - }, "callee": { "type": "FunctionExpression", "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":4,"column":1}}, @@ -66,7 +62,11 @@ "directives": [] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 16 + } }, "body": { "type": "ClassBody", diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json index aedf837aba..f6ac3d78c0 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json @@ -24,9 +24,6 @@ { "type": "ObjectProperty", "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -39,6 +36,9 @@ "type": "Identifier", "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17},"identifierName":"arguments"}, "name": "arguments" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json index 8f8fa354dc..f63276ddf0 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json @@ -24,9 +24,6 @@ { "type": "ObjectProperty", "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -39,6 +36,9 @@ "type": "Identifier", "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17},"identifierName":"arguments"}, "name": "arguments" + }, + "extra": { + "shorthand": true } } ] @@ -66,8 +66,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json index 03fdbd51b4..ae24d62cc0 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":38}}, - "extra": { - "parenthesized": true, - "parenStart": 14 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -28,9 +24,6 @@ { "type": "ObjectProperty", "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -52,6 +45,9 @@ "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31},"identifierName":"defValue"}, "name": "defValue" } + }, + "extra": { + "shorthand": true } } ] @@ -60,6 +56,10 @@ "type": "Identifier", "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38},"identifierName":"obj"}, "name": "obj" + }, + "extra": { + "parenthesized": true, + "parenStart": 14 } } } @@ -72,8 +72,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json index f30023ae8a..7cf350028a 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json @@ -24,9 +24,6 @@ { "type": "ObjectProperty", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -39,6 +36,9 @@ "type": "Identifier", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"this"}, "name": "this" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment-2/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment-2/output.json index 5c65c0eb47..41f6643a4f 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment-2/output.json @@ -13,10 +13,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ArrayPattern", @@ -28,11 +24,11 @@ "left": { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 2 - }, - "name": "a" + } }, "right": { "type": "ArrayExpression", @@ -46,6 +42,10 @@ "type": "ArrayExpression", "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17}}, "elements": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment/output.json index 26d23fd2ab..84fd681e2c 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment/output.json @@ -13,10 +13,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -39,10 +35,6 @@ "left": { "type": "MemberExpression", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "object": { "type": "Identifier", "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, @@ -53,15 +45,15 @@ "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"b"}, "name": "b" + }, + "extra": { + "parenthesized": true, + "parenStart": 6 } }, "right": { "type": "MemberExpression", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, - "extra": { - "parenthesized": true, - "parenStart": 14 - }, "object": { "type": "Identifier", "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"c"}, @@ -72,6 +64,10 @@ "type": "Identifier", "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"d"}, "name": "d" + }, + "extra": { + "parenthesized": true, + "parenStart": 14 } } } @@ -82,6 +78,10 @@ "type": "ObjectExpression", "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-object/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-object/output.json index 8e08d27476..3cef0b9a99 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-object/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-object/output.json @@ -13,10 +13,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -36,10 +32,6 @@ "value": { "type": "MemberExpression", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "object": { "type": "Identifier", "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, @@ -50,6 +42,10 @@ "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"b"}, "name": "b" + }, + "extra": { + "parenthesized": true, + "parenStart": 6 } } } @@ -59,6 +55,10 @@ "type": "ObjectExpression", "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-rest-member/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-rest-member/output.json index cbb65676f6..c4f10480d2 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-rest-member/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-rest-member/output.json @@ -24,10 +24,6 @@ "argument": { "type": "MemberExpression", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, - "extra": { - "parenthesized": true, - "parenStart": 4 - }, "object": { "type": "Identifier", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, @@ -38,6 +34,10 @@ "type": "Identifier", "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" + }, + "extra": { + "parenthesized": true, + "parenStart": 4 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json index 666f689539..18c73bae28 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json @@ -20,17 +20,17 @@ "left": { "type": "ArrayPattern", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "elements": [ { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } }, "right": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-in-arrow-param/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-in-arrow-param/output.json index ecb394e8b9..6dac82789c 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-in-arrow-param/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-in-arrow-param/output.json @@ -56,11 +56,11 @@ { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 21 - }, - "name": "a" + } } ] }, diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json index 42ff270411..da5177b72b 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json @@ -20,17 +20,10 @@ "left": { "type": "ObjectPattern", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectProperty", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -43,9 +36,16 @@ "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" + }, + "extra": { + "shorthand": true } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } }, "right": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json index 1aed305955..5ba71199db 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json @@ -57,8 +57,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json index 9cd2f3bc41..365b9a5d16 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json @@ -27,9 +27,6 @@ { "type": "ObjectProperty", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -42,6 +39,9 @@ "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json index 66942ac3de..7cb67dd52f 100644 --- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json +++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":29,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":29}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "generator": true, "async": false, @@ -39,6 +35,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json index 0f89457652..f2e53d1e1b 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json @@ -42,8 +42,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json index ea729da4b2..9ab3604321 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json @@ -77,9 +77,6 @@ { "type": "ObjectProperty", "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -92,6 +89,9 @@ "type": "Identifier", "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json index bccacaba39..1665441b3a 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json @@ -81,9 +81,6 @@ { "type": "ObjectProperty", "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -96,6 +93,9 @@ "type": "Identifier", "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json index 78efba09f1..697092f2d0 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json @@ -77,9 +77,6 @@ { "type": "ObjectProperty", "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -92,6 +89,9 @@ "type": "Identifier", "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json index c17efc0442..98dac86581 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json @@ -99,9 +99,6 @@ { "type": "ObjectProperty", "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -114,6 +111,9 @@ "type": "Identifier", "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36},"identifierName":"b"}, "name": "b" + }, + "extra": { + "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json index f3bb5a3a5f..b906d86301 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json @@ -58,9 +58,6 @@ { "type": "ObjectProperty", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -73,6 +70,9 @@ "type": "Identifier", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json index 0107e6652a..72332d3c95 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json @@ -30,9 +30,6 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -45,6 +42,9 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json index 1bf3a89cb8..91ee437ea8 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json @@ -30,9 +30,6 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -45,6 +42,9 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json index 7c2161e9e0..c9340dff84 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json @@ -63,9 +63,6 @@ { "type": "ObjectProperty", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -78,6 +75,9 @@ "type": "Identifier", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json index 4a3aa5c691..4829a0f8d4 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json @@ -55,9 +55,6 @@ { "type": "ObjectProperty", "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -70,6 +67,9 @@ "type": "Identifier", "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"Foo"}, "name": "Foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/output.json index c4477428d1..ec31ecff20 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/output.json @@ -10,24 +10,20 @@ { "type": "ExportNamedDeclaration", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":24}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " Four ", - "start":54,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}} - } - ], "specifiers": [ { "type": "ExportSpecifier", "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " One ", - "start":11,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} - } - ], + "local": { + "type": "Identifier", + "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, + "name": "Foo" + }, + "exported": { + "type": "Identifier", + "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, + "name": "Foo" + }, "trailingComments": [ { "type": "CommentBlock", @@ -40,16 +36,13 @@ "start":40,"end":51,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":13}} } ], - "local": { - "type": "Identifier", - "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, - "name": "Foo" - }, - "exported": { - "type": "Identifier", - "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, - "name": "Foo" - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " One ", + "start":11,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} + } + ] } ], "source": { @@ -61,7 +54,14 @@ }, "value": "foo" }, - "declaration": null + "declaration": null, + "innerComments": [ + { + "type": "CommentBlock", + "value": " Four ", + "start":54,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/output.json index 88113201c2..c0213cb3e3 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/output.json @@ -10,24 +10,20 @@ { "type": "ImportDeclaration", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":24}}, - "innerComments": [ - { - "type": "CommentBlock", - "value": " Four ", - "start":54,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}} - } - ], "specifiers": [ { "type": "ImportSpecifier", "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": " One ", - "start":11,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} - } - ], + "imported": { + "type": "Identifier", + "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, + "name": "Foo" + }, + "local": { + "type": "Identifier", + "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, + "name": "Foo" + }, "trailingComments": [ { "type": "CommentBlock", @@ -40,16 +36,13 @@ "start":40,"end":51,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":13}} } ], - "imported": { - "type": "Identifier", - "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, - "name": "Foo" - }, - "local": { - "type": "Identifier", - "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, - "name": "Foo" - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": " One ", + "start":11,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} + } + ] } ], "source": { @@ -60,7 +53,14 @@ "raw": "\"foo\"" }, "value": "foo" - } + }, + "innerComments": [ + { + "type": "CommentBlock", + "value": " Four ", + "start":54,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json index 7846ec071d..2a2b671d7f 100644 --- a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json +++ b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":1}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", @@ -54,7 +50,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json b/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json index 69d7161540..93589abd5d 100644 --- a/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json @@ -17,10 +17,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":57,"loc":{"start":{"line":1,"column":1},"end":{"line":4,"column":1}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", @@ -72,7 +68,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/regression/11183/output.json b/packages/babel-parser/test/fixtures/es2015/regression/11183/output.json index 8f8a462425..0d8bef7875 100644 --- a/packages/babel-parser/test/fixtures/es2015/regression/11183/output.json +++ b/packages/babel-parser/test/fixtures/es2015/regression/11183/output.json @@ -57,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":30,"end":42,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":27}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json index 832339a218..307612d39c 100644 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json @@ -27,17 +27,10 @@ "init": { "type": "ObjectExpression", "start":23,"end":57,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":43}}, - "extra": { - "parenthesized": true, - "parenStart": 22 - }, "properties": [ { "type": "ObjectProperty", "start":25,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":21}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -50,14 +43,14 @@ "type": "Identifier", "start":25,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":21},"identifierName":"implements"}, "name": "implements" + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":37,"end":46,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":32}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -70,14 +63,14 @@ "type": "Identifier", "start":37,"end":46,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":32},"identifierName":"interface"}, "name": "interface" + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":48,"end":55,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":41}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -90,9 +83,16 @@ "type": "Identifier", "start":48,"end":55,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":41},"identifierName":"package"}, "name": "package" + }, + "extra": { + "shorthand": true } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 22 + } } } ], @@ -107,8 +107,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json index a1f45dbc7b..93718ea67a 100644 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json @@ -27,17 +27,10 @@ "init": { "type": "ObjectExpression", "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, - "extra": { - "parenthesized": true, - "parenStart": 8 - }, "properties": [ { "type": "ObjectProperty", "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -50,14 +43,14 @@ "type": "Identifier", "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"const"}, "name": "const" + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -70,14 +63,14 @@ "type": "Identifier", "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20},"identifierName":"if"}, "name": "if" + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -90,9 +83,16 @@ "type": "Identifier", "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26},"identifierName":"this"}, "name": "this" + }, + "extra": { + "shorthand": true } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 8 + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json index 3be26026c0..8179346b19 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json @@ -61,8 +61,8 @@ "type": "DirectiveLiteral", "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/1/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/1/output.json index 024e4088a0..737911cb68 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/1/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, - "value": "\\u{714E}\\u{8336}", "extra": { - "raw": "\"\\u{714E}\\u{8336}\"", - "rawValue": "\\u{714E}\\u{8336}" - } + "rawValue": "\\u{714E}\\u{8336}", + "raw": "\"\\u{714E}\\u{8336}\"" + }, + "value": "\\u{714E}\\u{8336}" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json index 17191c0d4e..a447a5990b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ClassExpression", "start":15,"end":50,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":50}}, - "extra": { - "parenthesized": true, - "parenStart": 14 - }, "id": { "type": "Identifier", "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"A"}, @@ -67,6 +63,10 @@ } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 14 } } } @@ -79,8 +79,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json index 513548b108..11a1dfc9c3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json @@ -33,9 +33,6 @@ { "type": "ObjectProperty", "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -48,6 +45,9 @@ "type": "Identifier", "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/2/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/2/output.json index ba8837d8ed..97f47ba9fa 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/2/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, - "value": "\\u{20BB7}\\u{91CE}\\u{5BB6}", "extra": { - "raw": "\"\\u{20BB7}\\u{91CE}\\u{5BB6}\"", - "rawValue": "\\u{20BB7}\\u{91CE}\\u{5BB6}" - } + "rawValue": "\\u{20BB7}\\u{91CE}\\u{5BB6}", + "raw": "\"\\u{20BB7}\\u{91CE}\\u{5BB6}\"" + }, + "value": "\\u{20BB7}\\u{91CE}\\u{5BB6}" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json index 0a7ba19e8c..77d4a3ba54 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "extra": { - "raw": "\"\\u{}\"", - "rawValue": "\\u{}" + "rawValue": "\\u{}", + "raw": "\"\\u{}\"" }, "value": "\\u{}" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json index 38e1cffe17..70ba410d5e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "extra": { - "raw": "\"\\u{FFFF\"", - "rawValue": "\\u{FFFF" + "rawValue": "\\u{FFFF", + "raw": "\"\\u{FFFF\"" }, "value": "\\u{FFFF" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json index 1bb3874a63..37ca57bbc0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "extra": { - "raw": "\"\\u{FFZ}\"", - "rawValue": "\\u{FFZ}" + "rawValue": "\\u{FFZ}", + "raw": "\"\\u{FFZ}\"" }, "value": "\\u{FFZ}" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json index 3f041c90f9..2560f79d21 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -56,6 +52,10 @@ "raw": "42" }, "value": 42 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json index 6248583c3f..f77d6f076b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -57,6 +53,10 @@ "raw": "0" }, "value": 0 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json index bbd27877b4..c4f0ebb2e6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":55,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":55}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectProperty", @@ -85,7 +81,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -97,8 +97,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json index d32adee027..9759a59718 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}}, - "extra": { - "parenthesized": true, - "parenStart": 29 - }, "properties": [ { "type": "ObjectMethod", @@ -69,7 +65,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 29 + } } } ], @@ -81,8 +81,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json index 45702dde61..c39be795a7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":32,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":32}}, - "extra": { - "parenthesized": true, - "parenStart": 14 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -48,6 +44,10 @@ "type": "Identifier", "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"obj"}, "name": "obj" + }, + "extra": { + "parenthesized": true, + "parenStart": 14 } } } @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json index b09ddd2ba8..7b45b63bb0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":37,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":37}}, - "extra": { - "parenthesized": true, - "parenStart": 14 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -48,6 +44,10 @@ "type": "Identifier", "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37},"identifierName":"obj"}, "name": "obj" + }, + "extra": { + "parenthesized": true, + "parenStart": 14 } } } @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json index 2c169917e7..b19fb01211 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json index 39a48ce279..32f80188d4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json index 35d22ba742..774a720780 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json index d0530400d0..d7107dbcd0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json index 60534b0002..02f24861eb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json index 00536f4283..66b17dbc36 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json @@ -64,8 +64,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json index cba6699ec1..231718edbd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json index 8f898cf7a2..0371c06360 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json index 459d69dd1c..36e9811955 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json @@ -33,9 +33,6 @@ { "type": "ObjectProperty", "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -48,6 +45,9 @@ "type": "Identifier", "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"a"}, "name": "a" + }, + "extra": { + "shorthand": true } } ] @@ -69,8 +69,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json index 202c66fd71..fe100c84fc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json @@ -43,9 +43,6 @@ { "type": "ObjectProperty", "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -58,6 +55,9 @@ "type": "Identifier", "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"a"}, "name": "a" + }, + "extra": { + "shorthand": true } } ] @@ -91,9 +91,6 @@ { "type": "ObjectProperty", "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -106,6 +103,9 @@ "type": "Identifier", "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"a"}, "name": "a" + }, + "extra": { + "shorthand": true } } ] @@ -132,8 +132,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json index fd19040ec7..e32fc71556 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":30,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":30}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", @@ -54,8 +50,8 @@ "type": "DirectiveLiteral", "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } @@ -63,7 +59,11 @@ ] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json index 576ab926a3..85580b5100 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json @@ -54,8 +54,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json index 657451b675..2aeb907a0c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json index 242bb03d55..7749e4bde1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json @@ -52,8 +52,8 @@ "type": "DirectiveLiteral", "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/317/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/317/output.json index 28f11eec46..902f8d5001 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/317/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/317/output.json @@ -32,12 +32,12 @@ "pattern": "\\d", "flags": "" }, + "computed": false, "property": { "type": "Identifier", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"exec"}, "name": "exec" - }, - "computed": false + } }, "arguments": [ { @@ -51,6 +51,7 @@ } ] }, + "computed": true, "property": { "type": "NumericLiteral", "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, @@ -59,8 +60,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } ], "quasis": [ diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json index f174e19715..164f1f8bc6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json index 16b020830e..6101e4acbf 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":31,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":31}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectProperty", @@ -63,7 +59,11 @@ "value": 2 } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json index 822c188c28..2efe9acc04 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectProperty", @@ -67,7 +63,11 @@ "value": 2 } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json index d37721dbb3..91ff35f84f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json @@ -24,9 +24,6 @@ { "type": "ObjectProperty", "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -39,6 +36,9 @@ "type": "Identifier", "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"await"}, "name": "await" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json index 33eb4cdaeb..9924851cd7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json @@ -28,9 +28,6 @@ { "type": "ObjectProperty", "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -43,6 +40,9 @@ "type": "Identifier", "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"await"}, "name": "await" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json index 61c6bc52d5..f97f5228b9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json @@ -24,9 +24,6 @@ { "type": "ObjectProperty", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -39,6 +36,9 @@ "type": "Identifier", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json index c62b02696f..be2dfa3a3d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json @@ -24,9 +24,6 @@ { "type": "ObjectProperty", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -39,6 +36,9 @@ "type": "Identifier", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json index 4dfbf4c880..e92a200ea6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json @@ -28,9 +28,6 @@ { "type": "ObjectProperty", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -43,6 +40,9 @@ "type": "Identifier", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json index 2a8a6c47c5..53e25986a7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json @@ -28,9 +28,6 @@ { "type": "ObjectProperty", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -43,6 +40,9 @@ "type": "Identifier", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/394/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/394/output.json index 611110b17d..8ed0fbfe3a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/394/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/394/output.json @@ -65,12 +65,12 @@ "start":18,"end":19,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":2},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":20,"end":21,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"b"}, "name": "b" - }, - "computed": false + } } }, "right": { @@ -98,6 +98,7 @@ "start":30,"end":31,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":2},"identifierName":"a"}, "name": "a" }, + "computed": true, "property": { "type": "StringLiteral", "start":32,"end":35,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":6}}, @@ -106,8 +107,7 @@ "raw": "'c'" }, "value": "c" - }, - "computed": true + } } }, "right": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/5/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/5/output.json index 61be53c7f1..dcd1b11b46 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/5/output.json @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/9/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/9/output.json index 055a0e3f11..4c7cbff8f7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/9/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/9/output.json @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/basic-without-argument/output.json b/packages/babel-parser/test/fixtures/es2015/yield/basic-without-argument/output.json index 585d9f7a1a..fa65b0b27f 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/basic-without-argument/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/basic-without-argument/output.json @@ -36,12 +36,12 @@ "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25},"identifierName":"console"}, "name": "console" }, + "computed": false, "property": { "type": "Identifier", "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"log"}, "name": "log" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json index fd3cfcac38..4f53f79a0c 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json index 42b9092c1a..645a02f627 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json @@ -37,8 +37,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json b/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json index fb03bb79b2..4c18eb0144 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":25}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "generator": false, "async": false, @@ -52,6 +48,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json index 9dfb9b4ea9..d1a4085bd3 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json @@ -46,12 +46,12 @@ "right": { "type": "YieldExpression", "start":25,"end":30,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, + "delegate": false, + "argument": null, "extra": { "parenthesized": true, "parenStart": 24 - }, - "delegate": false, - "argument": null + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json index a1df12479b..773e169810 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", @@ -59,7 +55,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json index c80b95aa82..5bb4403888 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json @@ -52,8 +52,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json index dbd2ad8bb6..eb2d8a999c 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", @@ -49,7 +45,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json index e62c0c6f30..ccfbae44f1 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json index 9c8fcbc476..2a7b295700 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json @@ -43,8 +43,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/without-argument/output.json b/packages/babel-parser/test/fixtures/es2015/yield/without-argument/output.json index 4f10511f9b..6df795a1ed 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/without-argument/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/without-argument/output.json @@ -28,12 +28,12 @@ "expression": { "type": "YieldExpression", "start":19,"end":24,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8}}, + "delegate": false, + "argument": null, "extra": { "parenthesized": true, "parenStart": 18 - }, - "delegate": false, - "argument": null + } } }, { diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/nested-unary-before-exponential/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/nested-unary-before-exponential/output.json index 39f1b200ca..e466267b6d 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/nested-unary-before-exponential/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/nested-unary-before-exponential/output.json @@ -16,10 +16,6 @@ "expression": { "type": "BinaryExpression", "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "left": { "type": "UnaryExpression", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, @@ -50,6 +46,10 @@ "raw": "6" }, "value": 6 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/valid-parenthesized-await-before-exponential/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/valid-parenthesized-await-before-exponential/output.json index 3ca3c92f70..489e7be1ab 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/valid-parenthesized-await-before-exponential/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/valid-parenthesized-await-before-exponential/output.json @@ -23,10 +23,6 @@ "left": { "type": "AwaitExpression", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, - "extra": { - "parenthesized": true, - "parenStart": 12 - }, "argument": { "type": "NumericLiteral", "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, @@ -35,6 +31,10 @@ "raw": "5" }, "value": 5 + }, + "extra": { + "parenthesized": true, + "parenStart": 12 } }, "operator": "**", diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json index 6a5e1e7dc3..f606dfaad3 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json @@ -59,8 +59,8 @@ "type": "DirectiveLiteral", "start":42,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json index 4c980e3e7d..b2fb55f29d 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json @@ -50,8 +50,8 @@ "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json index 267844b650..90f7e7ae28 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json @@ -56,8 +56,8 @@ "type": "DirectiveLiteral", "start":30,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json index 0b4fa77f29..260459f4eb 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json @@ -56,8 +56,8 @@ "type": "DirectiveLiteral", "start":36,"end":48,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json index 30e5e501a7..322c4ab3e5 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":35,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json index b9fe0aeb25..7cd7275991 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":29,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json index 6664283642..b80dc8f024 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":30,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json index bd122e3c98..c3c2769121 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json @@ -68,8 +68,8 @@ "type": "DirectiveLiteral", "start":38,"end":50,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json index ddd14f6955..7901cc0924 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json @@ -68,8 +68,8 @@ "type": "DirectiveLiteral", "start":36,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json index 44c366ac4d..acf78bfecb 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json @@ -31,9 +31,6 @@ { "type": "ObjectProperty", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -46,14 +43,14 @@ "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -66,6 +63,9 @@ "type": "Identifier", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" + }, + "extra": { + "shorthand": true } } ] @@ -89,8 +89,8 @@ "type": "DirectiveLiteral", "start":42,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json index 5e2c92a1ad..6ede968bc3 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json @@ -28,9 +28,6 @@ { "type": "ObjectProperty", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -43,14 +40,14 @@ "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -63,6 +60,9 @@ "type": "Identifier", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" + }, + "extra": { + "shorthand": true } } ] @@ -80,8 +80,8 @@ "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json index fad417168b..0ef936e66a 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json @@ -43,8 +43,8 @@ "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json index 2128d0bb70..dd9fa2379a 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json @@ -33,11 +33,11 @@ "left": { "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 8 - }, - "name": "a" + } }, "right": { "type": "ArrayExpression", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json index 45e050fa07..2a4f15bf4e 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json @@ -37,11 +37,11 @@ { "type": "Identifier", "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 10 - }, - "name": "a" + } } ] }, diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json index cda35a9ea0..b224095896 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json @@ -32,11 +32,11 @@ { "type": "Identifier", "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 17 - }, - "name": "foo" + } } ], "body": { diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json index 3619f0e23d..62f1135d31 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json @@ -33,10 +33,6 @@ "left": { "type": "MemberExpression", "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 8 - }, "object": { "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, @@ -47,6 +43,10 @@ "type": "Identifier", "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" + }, + "extra": { + "parenthesized": true, + "parenStart": 8 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json index 5b69a068d2..e01a7535ab 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json @@ -36,11 +36,11 @@ { "type": "Identifier", "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 18 - }, - "name": "foo" + } } ] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-lhs-in-async-call-in-param/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-lhs-in-async-call-in-param/output.json index acf951ea05..434ec12106 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-lhs-in-async-call-in-param/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-lhs-in-async-call-in-param/output.json @@ -45,11 +45,11 @@ "left": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"f"}, + "name": "f", "extra": { "parenthesized": true, "parenStart": 18 - }, - "name": "f" + } }, "right": { "type": "ArrayExpression", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json index 753ce2f874..f7e66e4afb 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json @@ -39,11 +39,11 @@ "argument": { "type": "Identifier", "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 21 - }, - "name": "foo" + } } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json index e7bb475db2..a92ada98ea 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json @@ -39,11 +39,11 @@ "argument": { "type": "Identifier", "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 21 - }, - "name": "foo" + } } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array-pattern-lhs-member/output.json b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array-pattern-lhs-member/output.json index 539f3f151e..3b3017614f 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array-pattern-lhs-member/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array-pattern-lhs-member/output.json @@ -33,10 +33,6 @@ "left": { "type": "MemberExpression", "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 8 - }, "object": { "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, @@ -47,6 +43,10 @@ "type": "Identifier", "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" + }, + "extra": { + "parenthesized": true, + "parenStart": 8 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array-pattern-lhs/output.json b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array-pattern-lhs/output.json index 695ec8ee60..c61fec8667 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array-pattern-lhs/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array-pattern-lhs/output.json @@ -33,11 +33,11 @@ "left": { "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 8 - }, - "name": "a" + } }, "right": { "type": "ArrayExpression", diff --git a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array/output.json b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array/output.json index 05e7ace21e..d502e7b81c 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-array/output.json @@ -35,11 +35,11 @@ { "type": "Identifier", "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 18 - }, - "name": "foo" + } } ] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-identifier/output.json b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-identifier/output.json index a93ad5c761..8a6e7bcaef 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-identifier/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-argument-identifier/output.json @@ -31,11 +31,11 @@ { "type": "Identifier", "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 17 - }, - "name": "foo" + } } ] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-call-expression/output.json b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-call-expression/output.json index f9755098f1..d1804f8ec2 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-call-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-call-expression/output.json @@ -33,10 +33,6 @@ "left": { "type": "MemberExpression", "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 8 - }, "object": { "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, @@ -47,6 +43,10 @@ "type": "Identifier", "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" + }, + "extra": { + "parenthesized": true, + "parenStart": 8 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-spread-array/output.json b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-spread-array/output.json index 12cf4c8146..630e6ecbf0 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-spread-array/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-spread-array/output.json @@ -38,11 +38,11 @@ "argument": { "type": "Identifier", "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 21 - }, - "name": "foo" + } } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-spread-object/output.json b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-spread-object/output.json index 8edeffd62e..6e694ede29 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-spread-object/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-call/parenthesized-spread-object/output.json @@ -38,11 +38,11 @@ "argument": { "type": "Identifier", "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, + "name": "foo", "extra": { "parenthesized": true, "parenStart": 21 - }, - "name": "foo" + } } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json index 1db7ecbfb9..6f1b6b3c79 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"await"}, @@ -33,6 +29,10 @@ "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json index 4dee66c3f3..70ef18e077 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json @@ -42,9 +42,6 @@ { "type": "ObjectProperty", "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -57,6 +54,9 @@ "type": "Identifier", "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"await"}, "name": "await" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json index 8c943c2905..afcd6038e6 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json @@ -38,9 +38,6 @@ { "type": "ObjectProperty", "start":27,"end":30,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -53,6 +50,9 @@ "type": "Identifier", "start":27,"end":30,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json index 21b6c7bcf5..226cfa2e6f 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json @@ -17,10 +17,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":34,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":34}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "generator": false, "async": true, @@ -49,6 +45,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json index 06982744a5..55a9954afd 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json @@ -16,11 +16,11 @@ "expression": { "type": "Identifier", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6},"identifierName":"async"}, + "name": "async", "extra": { "parenthesized": true, "parenStart": 0 - }, - "name": "async" + } } }, { diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json index 2a05490d13..78754c61cf 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json @@ -28,9 +28,6 @@ { "type": "ObjectProperty", "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -58,14 +55,14 @@ } ] } + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":24,"end":37,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":37}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -89,9 +86,6 @@ { "type": "ObjectProperty", "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -104,10 +98,16 @@ "type": "Identifier", "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35},"identifierName":"await"}, "name": "await" + }, + "extra": { + "shorthand": true } } ] } + }, + "extra": { + "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json index a9717bd23e..9ddd2d38c7 100644 --- a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json +++ b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json @@ -16,14 +16,14 @@ "expression": { "type": "CallExpression", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "extra": { - "trailingComma": 4 - }, "callee": { "type": "Identifier", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"log"}, "name": "log" }, + "extra": { + "trailingComma": 4 + }, "arguments": [ null ] diff --git a/packages/babel-parser/test/fixtures/es2018/async-generators/class-method/output.json b/packages/babel-parser/test/fixtures/es2018/async-generators/class-method/output.json index 3cddfe78de..9e7b7b80d9 100644 --- a/packages/babel-parser/test/fixtures/es2018/async-generators/class-method/output.json +++ b/packages/babel-parser/test/fixtures/es2018/async-generators/class-method/output.json @@ -95,12 +95,12 @@ "type": "ThisExpression", "start":97,"end":101,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":28}} }, + "computed": false, "property": { "type": "Identifier", "start":102,"end":107,"loc":{"start":{"line":4,"column":29},"end":{"line":4,"column":34},"identifierName":"query"}, "name": "query" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/es2018/async-generators/object-method/output.json b/packages/babel-parser/test/fixtures/es2018/async-generators/object-method/output.json index 47180d5c75..b33b7fa509 100644 --- a/packages/babel-parser/test/fixtures/es2018/async-generators/object-method/output.json +++ b/packages/babel-parser/test/fixtures/es2018/async-generators/object-method/output.json @@ -98,12 +98,12 @@ "type": "ThisExpression", "start":99,"end":103,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":28}} }, + "computed": false, "property": { "type": "Identifier", "start":104,"end":109,"loc":{"start":{"line":4,"column":29},"end":{"line":4,"column":34},"identifierName":"query"}, "name": "query" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json index 0d9f06020d..fedcb8cafc 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json @@ -61,9 +61,6 @@ { "type": "ObjectProperty", "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -76,6 +73,9 @@ "type": "Identifier", "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"bar"}, "name": "bar" + }, + "extra": { + "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json index cc18e28240..041591ff0b 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json @@ -30,9 +30,6 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -45,6 +42,9 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" + }, + "extra": { + "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json index 122a80e437..223ec1fcad 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json @@ -76,9 +76,6 @@ { "type": "ObjectProperty", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -91,6 +88,9 @@ "type": "Identifier", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" + }, + "extra": { + "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json index 922118de7a..878cb42bba 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json @@ -70,9 +70,6 @@ { "type": "ObjectProperty", "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -85,6 +82,9 @@ "type": "Identifier", "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"baz"}, "name": "baz" + }, + "extra": { + "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json index 2d3704afc9..c3fb77839a 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json @@ -74,9 +74,6 @@ { "type": "ObjectProperty", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -89,6 +86,9 @@ "type": "Identifier", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" + }, + "extra": { + "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json index 008f56a84b..0d1c28b60e 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -40,6 +36,10 @@ "type": "ObjectExpression", "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json index 0147452386..f2011c4a20 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -53,6 +49,10 @@ "type": "ObjectExpression", "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json index a6c57e547a..22bcc3a64f 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -40,6 +36,10 @@ "type": "ObjectExpression", "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json index 2643b6ca98..8ccee8a089 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json @@ -20,16 +20,10 @@ "id": { "type": "ObjectPattern", "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, - "extra": { - "trailingComma": 16 - }, "properties": [ { "type": "ObjectProperty", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -42,14 +36,14 @@ "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -62,6 +56,9 @@ "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" + }, + "extra": { + "shorthand": true } }, { @@ -73,7 +70,10 @@ "name": "z" } } - ] + ], + "extra": { + "trailingComma": 16 + } }, "init": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/directive-line-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/directive-line-separator/output.json index cce89e8969..90a232747b 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/directive-line-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/directive-line-separator/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, - "value": "before
after", "extra": { - "raw": "\"before
after\"", - "rawValue": "before
after" - } + "rawValue": "before
after", + "raw": "\"before
after\"" + }, + "value": "before
after" }, "trailingComments": [ { diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/directive-paragraph-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/directive-paragraph-separator/output.json index 2c98f41934..47abed09f5 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/directive-paragraph-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/directive-paragraph-separator/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, - "value": "before
after", "extra": { - "raw": "\"before
after\"", - "rawValue": "before
after" - } + "rawValue": "before
after", + "raw": "\"before
after\"" + }, + "value": "before
after" }, "trailingComments": [ { diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json index 1f818955c2..060dd04c48 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json @@ -16,13 +16,13 @@ "expression": { "type": "CallExpression", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, - "extra": { - "trailingComma": 12 - }, "callee": { "type": "Import", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}} }, + "extra": { + "trailingComma": 12 + }, "arguments": [ { "type": "StringLiteral", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-strict/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-strict/output.json index d6607373b7..7f4fb61c01 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-strict/output.json @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/top-level/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/top-level/output.json index af065bea07..d5ab76ed81 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/top-level/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/top-level/output.json @@ -128,12 +128,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":97,"end":101,"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":25},"identifierName":"then"}, "name": "then" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/variable-arguments/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/variable-arguments/output.json index b631aff245..545bfe03dd 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/variable-arguments/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/variable-arguments/output.json @@ -56,12 +56,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":51,"end":55,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":24},"identifierName":"then"}, "name": "then" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/es2020/import-meta/valid-in-module/output.json b/packages/babel-parser/test/fixtures/es2020/import-meta/valid-in-module/output.json index f7c0f728ad..b2128fe153 100644 --- a/packages/babel-parser/test/fixtures/es2020/import-meta/valid-in-module/output.json +++ b/packages/babel-parser/test/fixtures/es2020/import-meta/valid-in-module/output.json @@ -66,12 +66,12 @@ "name": "meta" } }, + "computed": false, "property": { "type": "Identifier", "start":47,"end":50,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":27},"identifierName":"url"}, "name": "url" - }, - "computed": false + } } } ], @@ -115,12 +115,12 @@ "name": "meta" } }, + "computed": false, "property": { "type": "Identifier", "start":77,"end":80,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":15},"identifierName":"url"}, "name": "url" - }, - "computed": false + } } }, { @@ -147,12 +147,12 @@ "name": "meta" } }, + "computed": false, "property": { "type": "Identifier", "start":94,"end":108,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":26},"identifierName":"couldBeMutable"}, "name": "couldBeMutable" - }, - "computed": false + } }, "right": { "type": "BooleanLiteral", diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/call-trailing-comma-comments/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/call-trailing-comma-comments/output.json index caad902086..db94b70831 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/call-trailing-comma-comments/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/call-trailing-comma-comments/output.json @@ -10,13 +10,6 @@ { "type": "ExpressionStatement", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 2 ", - "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} - } - ], "expression": { "type": "OptionalCallExpression", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, @@ -30,17 +23,24 @@ { "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, + "name": "x", "trailingComments": [ { "type": "CommentBlock", "value": " 1 ", "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}} } - ], - "name": "x" + ] } ] - } + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 2 ", + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/chaining-off-optionally-chained-keys-named-class-or-function/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/chaining-off-optionally-chained-keys-named-class-or-function/output.json index 705c98e5d1..137a9db66f 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/chaining-off-optionally-chained-keys-named-class-or-function/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/chaining-off-optionally-chained-keys-named-class-or-function/output.json @@ -21,20 +21,20 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"class"}, "name": "class" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": false } }, @@ -52,20 +52,20 @@ "start":15,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":20,"end":28,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":13},"identifierName":"function"}, "name": "function" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":29,"end":32,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": false } }, @@ -86,28 +86,28 @@ "start":33,"end":36,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":38,"end":41,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":8},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":43,"end":48,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":15},"identifierName":"class"}, "name": "class" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":49,"end":52,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": false } }, @@ -125,20 +125,20 @@ "start":53,"end":56,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":58,"end":66,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13},"identifierName":"function"}, "name": "function" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":68,"end":71,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":18},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/function-call/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/function-call/output.json index 81a9ea975a..2e86074a65 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/function-call/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/function-call/output.json @@ -62,12 +62,12 @@ "start":24,"end":25,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":27,"end":31,"loc":{"start":{"line":5,"column":3},"end":{"line":5,"column":7},"identifierName":"func"}, "name": "func" }, - "computed": false, "optional": true }, "optional": true, @@ -88,12 +88,12 @@ "start":37,"end":38,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":40,"end":44,"loc":{"start":{"line":7,"column":3},"end":{"line":7,"column":7},"identifierName":"func"}, "name": "func" }, - "computed": false, "optional": true }, "optional": true, @@ -125,12 +125,12 @@ "start":54,"end":55,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":56,"end":60,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":6},"identifierName":"func"}, "name": "func" - }, - "computed": false + } }, "optional": true, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access-bracket/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access-bracket/output.json index 22f3e7a04f..6dca24cd63 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access-bracket/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access-bracket/output.json @@ -18,12 +18,12 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": true, "property": { "type": "Identifier", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"expr"}, "name": "expr" }, - "computed": true, "optional": true } }, @@ -41,20 +41,20 @@ "start":13,"end":16,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": true, "property": { "type": "Identifier", "start":19,"end":23,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":10},"identifierName":"expr"}, "name": "expr" }, - "computed": true, "optional": true }, + "computed": true, "property": { "type": "Identifier", "start":27,"end":32,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":19},"identifierName":"other"}, "name": "other" }, - "computed": true, "optional": true } }, @@ -69,12 +69,12 @@ "start":35,"end":38,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": true, "property": { "type": "BooleanLiteral", "start":41,"end":45,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":10}}, "value": true }, - "computed": true, "optional": true } }, @@ -92,20 +92,20 @@ "start":48,"end":51,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": true, "property": { "type": "BooleanLiteral", "start":54,"end":58,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":10}}, "value": true }, - "computed": true, "optional": true }, + "computed": true, "property": { "type": "BooleanLiteral", "start":62,"end":66,"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":18}}, "value": true }, - "computed": true, "optional": true } }, @@ -123,19 +123,19 @@ "start":69,"end":72,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": false, "property": { "type": "Identifier", "start":73,"end":74,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } }, + "computed": true, "property": { "type": "Identifier", "start":77,"end":81,"loc":{"start":{"line":9,"column":8},"end":{"line":9,"column":12},"identifierName":"expr"}, "name": "expr" }, - "computed": true, "optional": true } }, @@ -153,19 +153,19 @@ "start":84,"end":87,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": false, "property": { "type": "Identifier", "start":88,"end":89,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } }, + "computed": true, "property": { "type": "BooleanLiteral", "start":92,"end":96,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":12}}, "value": true }, - "computed": true, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access/output.json index fcb6aa51b0..03e7895707 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access/output.json @@ -18,12 +18,12 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true } }, @@ -41,20 +41,20 @@ "start":10,"end":13,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":8},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":20,"end":23,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":13},"identifierName":"baz"}, "name": "baz" }, - "computed": false, "optional": true } }, @@ -72,19 +72,19 @@ "start":25,"end":28,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":29,"end":32,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":34,"end":37,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":12},"identifierName":"baz"}, "name": "baz" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optioanl-chain-expression/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optioanl-chain-expression/output.json index d933036a0a..93b4d540ca 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optioanl-chain-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optioanl-chain-expression/output.json @@ -24,19 +24,19 @@ "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"b"}, "name": "b" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"c"}, "name": "c" }, - "computed": false, "optional": true }, "optional": false, diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/parenthised-chain/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/parenthised-chain/output.json index fc353364c2..46a12d4750 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/parenthised-chain/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/parenthised-chain/output.json @@ -21,24 +21,24 @@ "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true, "extra": { "parenthesized": true, "parenStart": 0 } }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"c"}, "name": "c" - }, - "computed": false + } } }, { @@ -58,24 +58,24 @@ "start":12,"end":13,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":2},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":15,"end":16,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true, "extra": { "parenthesized": true, "parenStart": 11 } }, + "computed": false, "property": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"c"}, "name": "c" - }, - "computed": false + } }, "arguments": [] } @@ -100,40 +100,40 @@ "start":25,"end":26,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":2},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":28,"end":29,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":5},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true, "extra": { "parenthesized": true, "parenStart": 24 } }, + "computed": false, "property": { "type": "Identifier", "start":32,"end":33,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":9},"identifierName":"c"}, "name": "c" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":34,"end":35,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":11},"identifierName":"d"}, "name": "d" }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":37,"end":38,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":14},"identifierName":"e"}, "name": "e" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/separated-chaining/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/separated-chaining/output.json index 83b934aec1..788c61213c 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/separated-chaining/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/separated-chaining/output.json @@ -30,44 +30,44 @@ "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"c"}, "name": "c" }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"d"}, "name": "d" }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"e"}, "name": "e" }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"f"}, "name": "f" }, - "computed": false, "optional": true } }, @@ -94,42 +94,42 @@ "start":15,"end":16,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":17,"end":18,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"b"}, "name": "b" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"c"}, "name": "c" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"d"}, "name": "d" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":24,"end":25,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"e"}, "name": "e" }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":26,"end":27,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":12},"identifierName":"f"}, "name": "f" }, - "computed": false, "optional": false } } diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/super-method-class/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/super-method-class/output.json index b0b4f5871f..41a084a893 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/super-method-class/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/super-method-class/output.json @@ -58,12 +58,12 @@ }, "arguments": [] }, + "computed": false, "property": { "type": "Identifier", "start":56,"end":57,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":18},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2021/for-async-of/parens/output.json b/packages/babel-parser/test/fixtures/es2021/for-async-of/parens/output.json index 758ab36cf5..f531778e52 100644 --- a/packages/babel-parser/test/fixtures/es2021/for-async-of/parens/output.json +++ b/packages/babel-parser/test/fixtures/es2021/for-async-of/parens/output.json @@ -14,11 +14,11 @@ "left": { "type": "Identifier", "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"async"}, + "name": "async", "extra": { "parenthesized": true, "parenStart": 5 - }, - "name": "async" + } }, "right": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/and-and-equals/output.json b/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/and-and-equals/output.json index f76347f82a..8051c89968 100644 --- a/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/and-and-equals/output.json +++ b/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/and-and-equals/output.json @@ -41,12 +41,12 @@ "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } }, "right": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/mallet/output.json b/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/mallet/output.json index 82f46579d4..07efe35f59 100644 --- a/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/mallet/output.json +++ b/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/mallet/output.json @@ -41,12 +41,12 @@ "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } }, "right": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/qq-equals/output.json b/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/qq-equals/output.json index 6e6d1bea81..54f4f99b92 100644 --- a/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/qq-equals/output.json +++ b/packages/babel-parser/test/fixtures/es2021/logical-assignment-operator/qq-equals/output.json @@ -41,12 +41,12 @@ "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"obj"}, "name": "obj" }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } }, "right": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json index 36528253f5..980fb7a008 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "extra": { - "raw": "\"\\x1_0\"", - "rawValue": "\\x1_0" + "rawValue": "\\x1_0", + "raw": "\"\\x1_0\"" }, "value": "\\x1_0" } diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json index e0f00b4919..327793b4c9 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "extra": { - "raw": "\"\\u12_34\"", - "rawValue": "\\u12_34" + "rawValue": "\\u12_34", + "raw": "\"\\u12_34\"" }, "value": "\\u12_34" } diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json index c6b449b5b9..13e4a566fc 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"\\u{1F_639}\"", - "rawValue": "\\u{1F_639}" + "rawValue": "\\u{1F_639}", + "raw": "\"\\u{1F_639}\"" }, "value": "\\u{1F_639}" } diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-methods/async-generator/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/async-generator/output.json index b8cbd6ca0a..dd5e218191 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-methods/async-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-methods/async-generator/output.json @@ -108,12 +108,12 @@ "start":102,"end":106,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":18},"identifierName":"file"}, "name": "file" }, + "computed": false, "property": { "type": "Identifier", "start":107,"end":110,"loc":{"start":{"line":6,"column":19},"end":{"line":6,"column":22},"identifierName":"EOF"}, "name": "EOF" - }, - "computed": false + } } }, "body": { @@ -141,12 +141,12 @@ "start":134,"end":138,"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":24},"identifierName":"file"}, "name": "file" }, + "computed": false, "property": { "type": "Identifier", "start":139,"end":147,"loc":{"start":{"line":7,"column":25},"end":{"line":7,"column":33},"identifierName":"readLine"}, "name": "readLine" - }, - "computed": false + } }, "arguments": [] } @@ -182,12 +182,12 @@ "start":187,"end":191,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":16},"identifierName":"file"}, "name": "file" }, + "computed": false, "property": { "type": "Identifier", "start":192,"end":197,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":22},"identifierName":"close"}, "name": "close" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json index d423f26aeb..ef948998dd 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json @@ -222,12 +222,12 @@ "start":139,"end":143,"loc":{"start":{"line":14,"column":11},"end":{"line":14,"column":15},"identifierName":"Math"}, "name": "Math" }, + "computed": false, "property": { "type": "Identifier", "start":144,"end":150,"loc":{"start":{"line":14,"column":16},"end":{"line":14,"column":22},"identifierName":"random"}, "name": "random" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json index 61bcf07c5a..aa89f611a5 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json @@ -72,6 +72,7 @@ "type": "ThisExpression", "start":46,"end":50,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}} }, + "computed": false, "property": { "type": "PrivateName", "start":51,"end":53,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":18}}, @@ -80,8 +81,7 @@ "start":52,"end":53,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":18},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } ] diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json index f610c07abe..63e70d4346 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json @@ -40,6 +40,7 @@ "type": "ThisExpression", "start":17,"end":21,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11}} }, + "computed": false, "property": { "type": "PrivateName", "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, @@ -48,8 +49,7 @@ "start":23,"end":24,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } }, { diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json index 6aabfae0aa..eada7a9d1b 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json @@ -136,6 +136,7 @@ "type": "ThisExpression", "start":69,"end":73,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":8}} }, + "computed": false, "property": { "type": "PrivateName", "start":74,"end":76,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":11}}, @@ -144,8 +145,7 @@ "start":75,"end":76,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":11},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -174,6 +174,7 @@ "type": "ThisExpression", "start":87,"end":91,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":8}} }, + "computed": false, "property": { "type": "PrivateName", "start":92,"end":94,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":11}}, @@ -182,8 +183,7 @@ "start":93,"end":94,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":11},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -212,12 +212,12 @@ "type": "ThisExpression", "start":106,"end":110,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":8}} }, + "computed": false, "property": { "type": "Identifier", "start":111,"end":114,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":12},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } }, "right": { "type": "ClassExpression", @@ -344,6 +344,7 @@ "type": "ThisExpression", "start":196,"end":200,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":12}} }, + "computed": false, "property": { "type": "PrivateName", "start":201,"end":203,"loc":{"start":{"line":14,"column":13},"end":{"line":14,"column":15}}, @@ -352,8 +353,7 @@ "start":202,"end":203,"loc":{"start":{"line":14,"column":14},"end":{"line":14,"column":15},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -382,6 +382,7 @@ "type": "ThisExpression", "start":218,"end":222,"loc":{"start":{"line":15,"column":8},"end":{"line":15,"column":12}} }, + "computed": false, "property": { "type": "PrivateName", "start":223,"end":225,"loc":{"start":{"line":15,"column":13},"end":{"line":15,"column":15}}, @@ -390,8 +391,7 @@ "start":224,"end":225,"loc":{"start":{"line":15,"column":14},"end":{"line":15,"column":15},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -439,6 +439,7 @@ "type": "ThisExpression", "start":264,"end":268,"loc":{"start":{"line":18,"column":23},"end":{"line":18,"column":27}} }, + "computed": false, "property": { "type": "PrivateName", "start":269,"end":271,"loc":{"start":{"line":18,"column":28},"end":{"line":18,"column":30}}, @@ -447,8 +448,7 @@ "start":270,"end":271,"loc":{"start":{"line":18,"column":29},"end":{"line":18,"column":30},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } ], @@ -494,6 +494,7 @@ "type": "ThisExpression", "start":295,"end":299,"loc":{"start":{"line":19,"column":21},"end":{"line":19,"column":25}} }, + "computed": false, "property": { "type": "PrivateName", "start":300,"end":302,"loc":{"start":{"line":19,"column":26},"end":{"line":19,"column":28}}, @@ -502,8 +503,7 @@ "start":301,"end":302,"loc":{"start":{"line":19,"column":27},"end":{"line":19,"column":28},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -551,6 +551,7 @@ "type": "ThisExpression", "start":338,"end":342,"loc":{"start":{"line":21,"column":23},"end":{"line":21,"column":27}} }, + "computed": false, "property": { "type": "PrivateName", "start":343,"end":345,"loc":{"start":{"line":21,"column":28},"end":{"line":21,"column":30}}, @@ -559,8 +560,7 @@ "start":344,"end":345,"loc":{"start":{"line":21,"column":29},"end":{"line":21,"column":30},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } ], @@ -606,6 +606,7 @@ "type": "ThisExpression", "start":369,"end":373,"loc":{"start":{"line":22,"column":21},"end":{"line":22,"column":25}} }, + "computed": false, "property": { "type": "PrivateName", "start":374,"end":376,"loc":{"start":{"line":22,"column":26},"end":{"line":22,"column":28}}, @@ -614,8 +615,7 @@ "start":375,"end":376,"loc":{"start":{"line":22,"column":27},"end":{"line":22,"column":28},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -675,6 +675,7 @@ "type": "ThisExpression", "start":414,"end":418,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":29}} }, + "computed": false, "property": { "type": "PrivateName", "start":419,"end":421,"loc":{"start":{"line":24,"column":30},"end":{"line":24,"column":32}}, @@ -683,8 +684,7 @@ "start":420,"end":421,"loc":{"start":{"line":24,"column":31},"end":{"line":24,"column":32},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -695,6 +695,7 @@ "start":426,"end":427,"loc":{"start":{"line":24,"column":37},"end":{"line":24,"column":38},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":428,"end":430,"loc":{"start":{"line":24,"column":39},"end":{"line":24,"column":41}}, @@ -703,8 +704,7 @@ "start":429,"end":430,"loc":{"start":{"line":24,"column":40},"end":{"line":24,"column":41},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } }, "operator": "&&", @@ -718,6 +718,7 @@ "type": "ThisExpression", "start":434,"end":438,"loc":{"start":{"line":24,"column":45},"end":{"line":24,"column":49}} }, + "computed": false, "property": { "type": "PrivateName", "start":439,"end":441,"loc":{"start":{"line":24,"column":50},"end":{"line":24,"column":52}}, @@ -726,8 +727,7 @@ "start":440,"end":441,"loc":{"start":{"line":24,"column":51},"end":{"line":24,"column":52},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -738,6 +738,7 @@ "start":446,"end":447,"loc":{"start":{"line":24,"column":57},"end":{"line":24,"column":58},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":448,"end":450,"loc":{"start":{"line":24,"column":59},"end":{"line":24,"column":61}}, @@ -746,8 +747,7 @@ "start":449,"end":450,"loc":{"start":{"line":24,"column":60},"end":{"line":24,"column":61},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } } @@ -789,6 +789,7 @@ "type": "ThisExpression", "start":490,"end":494,"loc":{"start":{"line":26,"column":36},"end":{"line":26,"column":40}} }, + "computed": false, "property": { "type": "PrivateName", "start":495,"end":497,"loc":{"start":{"line":26,"column":41},"end":{"line":26,"column":43}}, @@ -797,8 +798,7 @@ "start":496,"end":497,"loc":{"start":{"line":26,"column":42},"end":{"line":26,"column":43},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, { "type": "MemberExpression", @@ -807,6 +807,7 @@ "type": "ThisExpression", "start":503,"end":507,"loc":{"start":{"line":26,"column":49},"end":{"line":26,"column":53}} }, + "computed": false, "property": { "type": "PrivateName", "start":508,"end":510,"loc":{"start":{"line":26,"column":54},"end":{"line":26,"column":56}}, @@ -815,8 +816,7 @@ "start":509,"end":510,"loc":{"start":{"line":26,"column":55},"end":{"line":26,"column":56},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } ], "quasis": [ @@ -892,6 +892,7 @@ "type": "ThisExpression", "start":548,"end":552,"loc":{"start":{"line":30,"column":19},"end":{"line":30,"column":23}} }, + "computed": false, "property": { "type": "PrivateName", "start":553,"end":555,"loc":{"start":{"line":30,"column":24},"end":{"line":30,"column":26}}, @@ -900,8 +901,7 @@ "start":554,"end":555,"loc":{"start":{"line":30,"column":25},"end":{"line":30,"column":26},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } ], @@ -947,6 +947,7 @@ "type": "ThisExpression", "start":575,"end":579,"loc":{"start":{"line":31,"column":17},"end":{"line":31,"column":21}} }, + "computed": false, "property": { "type": "PrivateName", "start":580,"end":582,"loc":{"start":{"line":31,"column":22},"end":{"line":31,"column":24}}, @@ -955,8 +956,7 @@ "start":581,"end":582,"loc":{"start":{"line":31,"column":23},"end":{"line":31,"column":24},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -1004,6 +1004,7 @@ "type": "ThisExpression", "start":614,"end":618,"loc":{"start":{"line":33,"column":19},"end":{"line":33,"column":23}} }, + "computed": false, "property": { "type": "PrivateName", "start":619,"end":621,"loc":{"start":{"line":33,"column":24},"end":{"line":33,"column":26}}, @@ -1012,8 +1013,7 @@ "start":620,"end":621,"loc":{"start":{"line":33,"column":25},"end":{"line":33,"column":26},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } ], @@ -1059,6 +1059,7 @@ "type": "ThisExpression", "start":641,"end":645,"loc":{"start":{"line":34,"column":17},"end":{"line":34,"column":21}} }, + "computed": false, "property": { "type": "PrivateName", "start":646,"end":648,"loc":{"start":{"line":34,"column":22},"end":{"line":34,"column":24}}, @@ -1067,8 +1068,7 @@ "start":647,"end":648,"loc":{"start":{"line":34,"column":23},"end":{"line":34,"column":24},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -1128,6 +1128,7 @@ "type": "ThisExpression", "start":682,"end":686,"loc":{"start":{"line":36,"column":21},"end":{"line":36,"column":25}} }, + "computed": false, "property": { "type": "PrivateName", "start":687,"end":689,"loc":{"start":{"line":36,"column":26},"end":{"line":36,"column":28}}, @@ -1136,8 +1137,7 @@ "start":688,"end":689,"loc":{"start":{"line":36,"column":27},"end":{"line":36,"column":28},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -1148,6 +1148,7 @@ "start":694,"end":695,"loc":{"start":{"line":36,"column":33},"end":{"line":36,"column":34},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":696,"end":698,"loc":{"start":{"line":36,"column":35},"end":{"line":36,"column":37}}, @@ -1156,8 +1157,7 @@ "start":697,"end":698,"loc":{"start":{"line":36,"column":36},"end":{"line":36,"column":37},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } }, "operator": "&&", @@ -1171,6 +1171,7 @@ "type": "ThisExpression", "start":702,"end":706,"loc":{"start":{"line":36,"column":41},"end":{"line":36,"column":45}} }, + "computed": false, "property": { "type": "PrivateName", "start":707,"end":709,"loc":{"start":{"line":36,"column":46},"end":{"line":36,"column":48}}, @@ -1179,8 +1180,7 @@ "start":708,"end":709,"loc":{"start":{"line":36,"column":47},"end":{"line":36,"column":48},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -1191,6 +1191,7 @@ "start":714,"end":715,"loc":{"start":{"line":36,"column":53},"end":{"line":36,"column":54},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":716,"end":718,"loc":{"start":{"line":36,"column":55},"end":{"line":36,"column":57}}, @@ -1199,8 +1200,7 @@ "start":717,"end":718,"loc":{"start":{"line":36,"column":56},"end":{"line":36,"column":57},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } } @@ -1242,6 +1242,7 @@ "type": "ThisExpression", "start":754,"end":758,"loc":{"start":{"line":38,"column":32},"end":{"line":38,"column":36}} }, + "computed": false, "property": { "type": "PrivateName", "start":759,"end":761,"loc":{"start":{"line":38,"column":37},"end":{"line":38,"column":39}}, @@ -1250,8 +1251,7 @@ "start":760,"end":761,"loc":{"start":{"line":38,"column":38},"end":{"line":38,"column":39},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, { "type": "MemberExpression", @@ -1260,6 +1260,7 @@ "type": "ThisExpression", "start":767,"end":771,"loc":{"start":{"line":38,"column":45},"end":{"line":38,"column":49}} }, + "computed": false, "property": { "type": "PrivateName", "start":772,"end":774,"loc":{"start":{"line":38,"column":50},"end":{"line":38,"column":52}}, @@ -1268,8 +1269,7 @@ "start":773,"end":774,"loc":{"start":{"line":38,"column":51},"end":{"line":38,"column":52},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } ], "quasis": [ diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json index 2fe350f37e..3c46c3e101 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json @@ -150,14 +150,15 @@ "start":124,"end":125,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":7},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":127,"end":130,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":12},"identifierName":"Foo"}, "name": "Foo" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "PrivateName", "start":131,"end":133,"loc":{"start":{"line":8,"column":13},"end":{"line":8,"column":15}}, @@ -167,7 +168,6 @@ "name": "x" } }, - "computed": false, "optional": false }, { @@ -184,14 +184,15 @@ "start":141,"end":142,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":7},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":144,"end":147,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":12},"identifierName":"Foo"}, "name": "Foo" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "PrivateName", "start":148,"end":150,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":15}}, @@ -201,15 +202,14 @@ "name": "x" } }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":151,"end":158,"loc":{"start":{"line":9,"column":16},"end":{"line":9,"column":23},"identifierName":"toFixed"}, "name": "toFixed" }, - "computed": false, "optional": false }, { @@ -229,14 +229,15 @@ "start":166,"end":167,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":7},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":169,"end":172,"loc":{"start":{"line":10,"column":9},"end":{"line":10,"column":12},"identifierName":"Foo"}, "name": "Foo" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "PrivateName", "start":173,"end":175,"loc":{"start":{"line":10,"column":13},"end":{"line":10,"column":15}}, @@ -246,15 +247,14 @@ "name": "x" } }, - "computed": false, "optional": false }, + "computed": false, "property": { "type": "Identifier", "start":176,"end":183,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":23},"identifierName":"toFixed"}, "name": "toFixed" }, - "computed": false, "optional": false }, "optional": false, @@ -284,14 +284,15 @@ "start":194,"end":195,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":7},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":197,"end":200,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":12},"identifierName":"Foo"}, "name": "Foo" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "PrivateName", "start":201,"end":203,"loc":{"start":{"line":11,"column":13},"end":{"line":11,"column":15}}, @@ -301,7 +302,6 @@ "name": "m" } }, - "computed": false, "optional": false }, "optional": false, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json index 4f58452a48..c1a548e7b1 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json @@ -81,6 +81,7 @@ "start":71,"end":74,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":14},"identifierName":"Foo"}, "name": "Foo" }, + "computed": false, "property": { "type": "PrivateName", "start":76,"end":78,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, @@ -90,7 +91,6 @@ "name": "m" } }, - "computed": false, "optional": true }, "optional": false, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json index 3eff2947cf..70f496eed9 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json @@ -79,6 +79,7 @@ "start":59,"end":62,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":14},"identifierName":"Foo"}, "name": "Foo" }, + "computed": false, "property": { "type": "PrivateName", "start":64,"end":66,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, @@ -88,15 +89,14 @@ "name": "x" } }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":67,"end":74,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":26},"identifierName":"toFixed"}, "name": "toFixed" }, - "computed": false, "optional": false }, "optional": false, diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json index 44f1a1d054..b31bd9bef3 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json @@ -76,6 +76,7 @@ "start":59,"end":62,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":14},"identifierName":"Foo"}, "name": "Foo" }, + "computed": false, "property": { "type": "PrivateName", "start":64,"end":66,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, @@ -85,15 +86,14 @@ "name": "x" } }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":67,"end":74,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":26},"identifierName":"toFixed"}, "name": "toFixed" }, - "computed": false, "optional": false } } @@ -107,4 +107,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json index bf77ed55e9..58dca35cfd 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json @@ -73,6 +73,7 @@ "start":59,"end":62,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":14},"identifierName":"Foo"}, "name": "Foo" }, + "computed": false, "property": { "type": "PrivateName", "start":64,"end":66,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, @@ -82,7 +83,6 @@ "name": "x" } }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json index 31ce19c94e..3f887850ed 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json @@ -136,6 +136,7 @@ "type": "ThisExpression", "start":69,"end":73,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":8}} }, + "computed": false, "property": { "type": "PrivateName", "start":74,"end":76,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":11}}, @@ -144,8 +145,7 @@ "start":75,"end":76,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":11},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -174,6 +174,7 @@ "type": "ThisExpression", "start":87,"end":91,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":8}} }, + "computed": false, "property": { "type": "PrivateName", "start":92,"end":94,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":11}}, @@ -182,8 +183,7 @@ "start":93,"end":94,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":11},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -231,6 +231,7 @@ "type": "ThisExpression", "start":125,"end":129,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":23}} }, + "computed": false, "property": { "type": "PrivateName", "start":130,"end":132,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":26}}, @@ -239,8 +240,7 @@ "start":131,"end":132,"loc":{"start":{"line":10,"column":25},"end":{"line":10,"column":26},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } ], @@ -286,6 +286,7 @@ "type": "ThisExpression", "start":152,"end":156,"loc":{"start":{"line":11,"column":17},"end":{"line":11,"column":21}} }, + "computed": false, "property": { "type": "PrivateName", "start":157,"end":159,"loc":{"start":{"line":11,"column":22},"end":{"line":11,"column":24}}, @@ -294,8 +295,7 @@ "start":158,"end":159,"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":24},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -343,6 +343,7 @@ "type": "ThisExpression", "start":191,"end":195,"loc":{"start":{"line":13,"column":19},"end":{"line":13,"column":23}} }, + "computed": false, "property": { "type": "PrivateName", "start":196,"end":198,"loc":{"start":{"line":13,"column":24},"end":{"line":13,"column":26}}, @@ -351,8 +352,7 @@ "start":197,"end":198,"loc":{"start":{"line":13,"column":25},"end":{"line":13,"column":26},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } ], @@ -398,6 +398,7 @@ "type": "ThisExpression", "start":218,"end":222,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":21}} }, + "computed": false, "property": { "type": "PrivateName", "start":223,"end":225,"loc":{"start":{"line":14,"column":22},"end":{"line":14,"column":24}}, @@ -406,8 +407,7 @@ "start":224,"end":225,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":24},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "right": { "type": "UnaryExpression", @@ -467,6 +467,7 @@ "type": "ThisExpression", "start":259,"end":263,"loc":{"start":{"line":16,"column":21},"end":{"line":16,"column":25}} }, + "computed": false, "property": { "type": "PrivateName", "start":264,"end":266,"loc":{"start":{"line":16,"column":26},"end":{"line":16,"column":28}}, @@ -475,8 +476,7 @@ "start":265,"end":266,"loc":{"start":{"line":16,"column":27},"end":{"line":16,"column":28},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -487,6 +487,7 @@ "start":271,"end":272,"loc":{"start":{"line":16,"column":33},"end":{"line":16,"column":34},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":273,"end":275,"loc":{"start":{"line":16,"column":35},"end":{"line":16,"column":37}}, @@ -495,8 +496,7 @@ "start":274,"end":275,"loc":{"start":{"line":16,"column":36},"end":{"line":16,"column":37},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } }, "operator": "&&", @@ -510,6 +510,7 @@ "type": "ThisExpression", "start":279,"end":283,"loc":{"start":{"line":16,"column":41},"end":{"line":16,"column":45}} }, + "computed": false, "property": { "type": "PrivateName", "start":284,"end":286,"loc":{"start":{"line":16,"column":46},"end":{"line":16,"column":48}}, @@ -518,8 +519,7 @@ "start":285,"end":286,"loc":{"start":{"line":16,"column":47},"end":{"line":16,"column":48},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } }, "operator": "===", "right": { @@ -530,6 +530,7 @@ "start":291,"end":292,"loc":{"start":{"line":16,"column":53},"end":{"line":16,"column":54},"identifierName":"p"}, "name": "p" }, + "computed": false, "property": { "type": "PrivateName", "start":293,"end":295,"loc":{"start":{"line":16,"column":55},"end":{"line":16,"column":57}}, @@ -538,8 +539,7 @@ "start":294,"end":295,"loc":{"start":{"line":16,"column":56},"end":{"line":16,"column":57},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } } } @@ -581,6 +581,7 @@ "type": "ThisExpression", "start":331,"end":335,"loc":{"start":{"line":18,"column":32},"end":{"line":18,"column":36}} }, + "computed": false, "property": { "type": "PrivateName", "start":336,"end":338,"loc":{"start":{"line":18,"column":37},"end":{"line":18,"column":39}}, @@ -589,8 +590,7 @@ "start":337,"end":338,"loc":{"start":{"line":18,"column":38},"end":{"line":18,"column":39},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } }, { "type": "MemberExpression", @@ -599,6 +599,7 @@ "type": "ThisExpression", "start":344,"end":348,"loc":{"start":{"line":18,"column":45},"end":{"line":18,"column":49}} }, + "computed": false, "property": { "type": "PrivateName", "start":349,"end":351,"loc":{"start":{"line":18,"column":50},"end":{"line":18,"column":52}}, @@ -607,8 +608,7 @@ "start":350,"end":351,"loc":{"start":{"line":18,"column":51},"end":{"line":18,"column":52},"identifierName":"y"}, "name": "y" } - }, - "computed": false + } } ], "quasis": [ diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json index 7b6feb8100..12bf22d023 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json @@ -51,12 +51,12 @@ "type": "Super", "start":34,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19}} }, + "computed": false, "property": { "type": "Identifier", "start":40,"end":41,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json index 6952e399c1..7f01cd9129 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json @@ -73,12 +73,12 @@ "type": "Super", "start":44,"end":49,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}} }, + "computed": false, "property": { "type": "Identifier", "start":50,"end":51,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"c"}, "name": "c" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json index 2e1ffaf6cd..14761cd586 100644 --- a/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json @@ -41,13 +41,6 @@ { "type": "ClassProperty", "start":79,"end":94,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":19}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " here yield is an identifier reference", - "start":34,"end":74,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} - } - ], "static": false, "key": { "type": "Identifier", @@ -73,7 +66,14 @@ }, "value": 42 } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " here yield is an identifier reference", + "start":34,"end":74,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} + } + ] } ] } diff --git a/packages/babel-parser/test/fixtures/es2022/module-string-names/export-name-has-lone-surrogate/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/export-name-has-lone-surrogate/output.json index 858ff90483..c3b7fb44d7 100644 --- a/packages/babel-parser/test/fixtures/es2022/module-string-names/export-name-has-lone-surrogate/output.json +++ b/packages/babel-parser/test/fixtures/es2022/module-string-names/export-name-has-lone-surrogate/output.json @@ -56,13 +56,6 @@ { "type": "ExportNamedDeclaration", "start":26,"end":58,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " should throw", - "start":59,"end":74,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":48}} - } - ], "specifiers": [ { "type": "ExportSpecifier", @@ -84,25 +77,18 @@ } ], "source": null, - "declaration": null - }, - { - "type": "ExportNamedDeclaration", - "start":75,"end":107,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":32}}, - "leadingComments": [ + "declaration": null, + "trailingComments": [ { "type": "CommentLine", "value": " should throw", "start":59,"end":74,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":48}} } - ], - "trailingComments": [ - { - "type": "CommentLine", - "value": " should not throw", - "start":108,"end":127,"loc":{"start":{"line":3,"column":33},"end":{"line":3,"column":52}} - } - ], + ] + }, + { + "type": "ExportNamedDeclaration", + "start":75,"end":107,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":32}}, "specifiers": [ { "type": "ExportSpecifier", @@ -124,7 +110,21 @@ } ], "source": null, - "declaration": null + "declaration": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": " should not throw", + "start":108,"end":127,"loc":{"start":{"line":3,"column":33},"end":{"line":3,"column":52}} + } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " should throw", + "start":59,"end":74,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":48}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2022/module-string-names/namespace-export/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/namespace-export/output.json index 078b9d4716..0a2edc12eb 100644 --- a/packages/babel-parser/test/fixtures/es2022/module-string-names/namespace-export/output.json +++ b/packages/babel-parser/test/fixtures/es2022/module-string-names/namespace-export/output.json @@ -38,4 +38,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2022/regexp-match-indices/d-flag/output.json b/packages/babel-parser/test/fixtures/es2022/regexp-match-indices/d-flag/output.json index 09974d1dc0..7d6252ed5e 100644 --- a/packages/babel-parser/test/fixtures/es2022/regexp-match-indices/d-flag/output.json +++ b/packages/babel-parser/test/fixtures/es2022/regexp-match-indices/d-flag/output.json @@ -23,4 +23,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2022/top-level-await-unambiguous/ambiguous-script/output.json b/packages/babel-parser/test/fixtures/es2022/top-level-await-unambiguous/ambiguous-script/output.json index 0ade27b47b..8979ab0583 100644 --- a/packages/babel-parser/test/fixtures/es2022/top-level-await-unambiguous/ambiguous-script/output.json +++ b/packages/babel-parser/test/fixtures/es2022/top-level-await-unambiguous/ambiguous-script/output.json @@ -110,6 +110,7 @@ "start":41,"end":46,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":5},"identifierName":"await"}, "name": "await" }, + "computed": true, "property": { "type": "NumericLiteral", "start":49,"end":50,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":9}}, @@ -118,8 +119,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } }, { diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json index 55dc023701..98d3ee3242 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json @@ -44,8 +44,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0005/output.json index 68368affc1..364603e3a7 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0005/output.json @@ -44,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":49}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/directive-prolog/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/directive-prolog/migrated_0000/output.json index d9f6fda13c..65ff7608f3 100644 --- a/packages/babel-parser/test/fixtures/esprima/directive-prolog/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/directive-prolog/migrated_0000/output.json @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":30,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":30}}, - "value": "use\\x20strict", "extra": { - "raw": "'use\\x20strict'", - "rawValue": "use\\x20strict" - } + "rawValue": "use\\x20strict", + "raw": "'use\\x20strict'" + }, + "value": "use\\x20strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/directive-prolog/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/directive-prolog/migrated_0001/output.json index b2aee3e01f..06b518c615 100644 --- a/packages/babel-parser/test/fixtures/esprima/directive-prolog/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/directive-prolog/migrated_0001/output.json @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, - "value": "use\\nstrict", "extra": { - "raw": "'use\\nstrict'", - "rawValue": "use\\nstrict" - } + "rawValue": "use\\nstrict", + "raw": "'use\\nstrict'" + }, + "value": "use\\nstrict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json index 39f993b2da..199c594a16 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json @@ -54,8 +54,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json index 8fbcd6303c..1d3c2ccac5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json @@ -58,8 +58,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json index cadb9472d4..3acacddc45 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json @@ -32,9 +32,6 @@ { "type": "ObjectProperty", "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -47,6 +44,9 @@ "type": "Identifier", "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"a"}, "name": "a" + }, + "extra": { + "shorthand": true } } ] @@ -79,8 +79,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json index f1b868fe35..4e04dcd573 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json @@ -38,8 +38,8 @@ "type": "DirectiveLiteral", "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json index 61a859de87..3f722d1331 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json @@ -23,11 +23,11 @@ { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 1 - }, - "name": "a" + } } ], "body": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json index f3ce571366..a65dbdd4ef 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json @@ -23,11 +23,11 @@ { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, + "name": "a", "extra": { "parenthesized": true, "parenStart": 1 - }, - "name": "a" + } }, { "type": "RestElement", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/output.json index c22df6a3de..77d0eb9892 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/output.json @@ -29,6 +29,7 @@ "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, + "computed": true, "property": { "type": "NumericLiteral", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, @@ -37,8 +38,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/output.json index 6a8e67cf93..1cdec9cc63 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/output.json @@ -64,6 +64,7 @@ "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, + "computed": true, "property": { "type": "NumericLiteral", "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, @@ -72,8 +73,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json index a5a6d9c2b5..d8811934e3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -51,6 +47,10 @@ "raw": "0" }, "value": 0 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json index b820b5c7e5..610e97e47e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -51,6 +47,10 @@ "raw": "0" }, "value": 0 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json index 9fa150c0e0..4baba8a5a0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -57,6 +53,10 @@ "raw": "0" }, "value": 0 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/output.json index a57907e16d..9228b89c9d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/output.json @@ -125,6 +125,7 @@ "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"b"}, "name": "b" }, + "computed": true, "property": { "type": "NumericLiteral", "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, @@ -133,8 +134,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/output.json index bc2ea21636..9c64474599 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/output.json @@ -143,12 +143,12 @@ }, "arguments": [] }, + "computed": true, "property": { "type": "Identifier", "start":61,"end":62,"loc":{"start":{"line":6,"column":18},"end":{"line":6,"column":19},"identifierName":"a"}, "name": "a" - }, - "computed": true + } } }, { @@ -169,12 +169,12 @@ "type": "ThisExpression", "start":71,"end":75,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":10}} }, + "computed": false, "property": { "type": "Identifier", "start":76,"end":77,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":12},"identifierName":"a"}, "name": "a" - }, - "computed": false + } } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json index 67f4e66edc..866311d585 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json @@ -21,10 +21,6 @@ "left": { "type": "SequenceExpression", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "expressions": [ { "type": "Identifier", @@ -36,15 +32,15 @@ "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } }, "right": { "type": "SequenceExpression", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "expressions": [ { "type": "Identifier", @@ -56,7 +52,11 @@ "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"d"}, "name": "d" } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-from-as-identifier-3/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-from-as-identifier-3/output.json index 6af2532e85..da3408eea0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-from-as-identifier-3/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-from-as-identifier-3/output.json @@ -33,4 +33,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json index 49be2b39f7..d1adc88e3e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json @@ -16,11 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":57,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":57}}, - "extra": { - "trailingComma": 54, - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", @@ -80,7 +75,12 @@ "start":50,"end":54,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":54}} } } - ] + ], + "extra": { + "trailingComma": 54, + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json index eb0b2a900b..9f4733bb28 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectProperty", @@ -57,7 +53,11 @@ "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json index 74a2ebce68..05bc596781 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":37,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":37}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectProperty", @@ -53,7 +49,11 @@ "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}} } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json index 6a38c3c602..5e3012eb9e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectProperty", @@ -57,7 +53,11 @@ "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json index bae64cb26b..975c317ba8 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":41,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":41}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectProperty", @@ -61,7 +57,11 @@ "start":35,"end":39,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":39}} } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json index 6518a6c689..393e337748 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json @@ -16,11 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":60,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":60}}, - "extra": { - "trailingComma": 57, - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectMethod", @@ -86,7 +81,12 @@ "start":53,"end":57,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":57}} } } - ] + ], + "extra": { + "trailingComma": 57, + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/output.json index 61be53c7f1..dcd1b11b46 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/output.json @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/output.json index 055a0e3f11..4c7cbff8f7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/output.json @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/new_super/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/new_super/output.json index 7f6068365f..4ad9734f87 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/new_super/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/new_super/output.json @@ -56,12 +56,12 @@ "type": "Super", "start":44,"end":49,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":17}} }, + "computed": false, "property": { "type": "Identifier", "start":50,"end":53,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":21},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/super_computed/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/super_computed/output.json index 948a5de374..ea0c38104f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/super_computed/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/super_computed/output.json @@ -53,6 +53,7 @@ "type": "Super", "start":45,"end":50,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, + "computed": true, "property": { "type": "NumericLiteral", "start":51,"end":52,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22}}, @@ -61,8 +62,7 @@ "raw": "1" }, "value": 1 - }, - "computed": true + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/super_member/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/super_member/output.json index 1c2d10dbfc..a42d377dc2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/super_member/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/super_member/output.json @@ -53,12 +53,12 @@ "type": "Super", "start":45,"end":50,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, + "computed": false, "property": { "type": "Identifier", "start":51,"end":52,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22},"identifierName":"y"}, "name": "y" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/output.json index 5e53dbc37a..091528f17f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, - "value": "\\\\u{714E}\\\\u{8336}", "extra": { - "raw": "\"\\\\u{714E}\\\\u{8336}\"", - "rawValue": "\\\\u{714E}\\\\u{8336}" - } + "rawValue": "\\\\u{714E}\\\\u{8336}", + "raw": "\"\\\\u{714E}\\\\u{8336}\"" + }, + "value": "\\\\u{714E}\\\\u{8336}" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/output.json index 7f865efa66..19005fc097 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, - "value": "\\\\u{20BB7}\\\\u{91CE}\\\\u{5BB6}", "extra": { - "raw": "\"\\\\u{20BB7}\\\\u{91CE}\\\\u{5BB6}\"", - "rawValue": "\\\\u{20BB7}\\\\u{91CE}\\\\u{5BB6}" - } + "rawValue": "\\\\u{20BB7}\\\\u{91CE}\\\\u{5BB6}", + "raw": "\"\\\\u{20BB7}\\\\u{91CE}\\\\u{5BB6}\"" + }, + "value": "\\\\u{20BB7}\\\\u{91CE}\\\\u{5BB6}" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/output.json index f32f1372bd..d6a941618c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, - "value": "\\\\u{00000000034}", "extra": { - "raw": "\"\\\\u{00000000034}\"", - "rawValue": "\\\\u{00000000034}" - } + "rawValue": "\\\\u{00000000034}", + "raw": "\"\\\\u{00000000034}\"" + }, + "value": "\\\\u{00000000034}" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json index d4f4f1ea17..945c0656cf 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "generator": false, "async": false, @@ -52,6 +48,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json index 040d236d2b..fd2d8b66ee 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, @@ -33,6 +29,10 @@ "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json index 045b95268d..ede4f62756 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "generator": true, "async": false, @@ -35,6 +31,10 @@ "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json index 44d7dfc5a2..f4fcc372c7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "generator": true, "async": false, @@ -44,6 +40,10 @@ "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json index 9ab8f21d7e..7b2f184708 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json @@ -72,8 +72,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json index 3d1a5f1dda..a867264863 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json @@ -74,8 +74,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json index 8e11926634..56fcce708d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json @@ -16,10 +16,6 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 14 - }, "operator": "=", "left": { "type": "ArrayPattern", @@ -36,6 +32,10 @@ "type": "Identifier", "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"x"}, "name": "x" + }, + "extra": { + "parenthesized": true, + "parenStart": 14 } } } @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json index 019abccf9b..185170886a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json @@ -52,8 +52,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json index 8203838cbe..08b7c38a00 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json index 255f77939b..653a6b82ca 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json @@ -58,8 +58,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json index 948d656013..645565e6ce 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json @@ -45,8 +45,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json index 871b74efce..1229efbf77 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json @@ -43,8 +43,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json index ce1d3d4be9..65a978471f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json index 1318571305..b2ddb4fba3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":34,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":34}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, @@ -40,13 +36,17 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json index 1affee4273..19cca40415 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json @@ -47,8 +47,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json index 847e155c21..bdde2dc119 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json @@ -44,8 +44,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json index 54fc9d1959..3a42e81323 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json @@ -47,8 +47,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json index 71870094cf..0d22ab0c76 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json @@ -36,8 +36,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-call-expression-property/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-call-expression-property/output.json index 9bdfc13894..1474bf217a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-call-expression-property/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-call-expression-property/output.json @@ -36,12 +36,12 @@ "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"obj"}, "name": "obj" }, + "computed": false, "property": { "type": "Identifier", "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"yield"}, "name": "yield" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-member-expression-property/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-member-expression-property/output.json index 9d9e642fdf..81cb3454c5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-member-expression-property/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-member-expression-property/output.json @@ -37,12 +37,12 @@ "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"obj"}, "name": "obj" }, + "computed": false, "property": { "type": "Identifier", "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31},"identifierName":"yield"}, "name": "yield" - }, - "computed": false + } } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/output.json index f0e05e25a5..f826daaf77 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/output.json @@ -54,11 +54,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-strict-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-strict-method/output.json index d5baf7a875..dadf7a2873 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-strict-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-strict-method/output.json @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-super-property/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-super-property/output.json index 88ed22b68d..afccf6a440 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-super-property/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-super-property/output.json @@ -53,12 +53,12 @@ "type": "Super", "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}} }, + "computed": false, "property": { "type": "Identifier", "start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37},"identifierName":"yield"}, "name": "yield" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0004/output.json index 6b3dccf75c..42c4d64597 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0004/output.json @@ -26,12 +26,12 @@ }, "arguments": [] }, + "computed": false, "property": { "type": "Identifier", "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0005/output.json index 2a3507d72d..b044f76b67 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0005/output.json @@ -21,12 +21,12 @@ "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"foo"}, "name": "foo" }, + "computed": true, "property": { "type": "Identifier", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"bar"}, "name": "bar" - }, - "computed": true + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0006/output.json index 3a2644e842..2fed161803 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0006/output.json @@ -21,12 +21,12 @@ "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0007/output.json index 6dfef381ed..01c6ae642b 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0007/output.json @@ -30,12 +30,12 @@ "parenStart": 0 } }, + "computed": false, "property": { "type": "Identifier", "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0010/output.json index d55ddd1b61..d99247274c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0010/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0011/output.json index 90f241ea29..604e12fc91 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0011/output.json @@ -21,19 +21,19 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29},"identifierName":"solarsystem"}, "name": "solarsystem" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0012/output.json index 6ebb1a398b..3477033dd2 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0012/output.json @@ -24,26 +24,26 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29},"identifierName":"solarsystem"}, "name": "solarsystem" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35},"identifierName":"Earth"}, "name": "Earth" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0013/output.json index 35c3eaa5e2..f1c92b7513 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0013/output.json @@ -18,6 +18,7 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "SequenceExpression", "start":9,"end":37,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":37}}, @@ -33,8 +34,7 @@ "name": "otherUselessName" } ] - }, - "computed": true + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0014/output.json index 5ccfa4a76d..983fdcfeb5 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0014/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "Identifier", "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19},"identifierName":"galaxyName"}, "name": "galaxyName" - }, - "computed": true + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0015/output.json index 5fa10d856c..a82eeff097 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0015/output.json @@ -21,6 +21,7 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": true, "property": { "type": "NumericLiteral", "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11}}, @@ -29,15 +30,14 @@ "raw": "42" }, "value": 42 - }, - "computed": true + } }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0016/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0016/output.json index 5fe9e49343..c9f3852442 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0016/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0016/output.json @@ -33,12 +33,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0017/output.json index e7068fd5ca..cb29e5cc68 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0017/output.json @@ -39,12 +39,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"galaxies"}, "name": "galaxies" - }, - "computed": false + } }, "arguments": [ { @@ -76,12 +76,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41},"identifierName":"milkyway"}, "name": "milkyway" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0018/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0018/output.json index 645ac82f55..8c03d9bd93 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0018/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0018/output.json @@ -27,26 +27,26 @@ "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"earth"}, "name": "earth" }, + "computed": false, "property": { "type": "Identifier", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"asia"}, "name": "asia" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20},"identifierName":"Indonesia"}, "name": "Indonesia" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":21,"end":39,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":39},"identifierName":"prepareForElection"}, "name": "prepareForElection" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0019/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0019/output.json index 96d56d51f4..b24e188c0f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0019/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0019/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"if"}, "name": "if" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0020/output.json index 834a12a4eb..3f833a43ea 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0020/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0020/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"true"}, "name": "true" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0021/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0021/output.json index e7664cfc93..b6c5210d83 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0021/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0021/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"false"}, "name": "false" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0022/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0022/output.json index d9b4c0dd9e..e5ee7189d7 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0022/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0022/output.json @@ -18,12 +18,12 @@ "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"universe"}, "name": "universe" }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"null"}, "name": "null" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0013/output.json index 031ffabf46..e606084baa 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0013/output.json @@ -31,12 +31,12 @@ "pattern": "42", "flags": "g" }, + "computed": false, "property": { "type": "Identifier", "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"test"}, "name": "test" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0000/output.json index 06adbec3fd..b21a141016 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0000/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, - "value": "Hello", "extra": { - "raw": "\"Hello\"", - "rawValue": "Hello" - } + "rawValue": "Hello", + "raw": "\"Hello\"" + }, + "value": "Hello" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0001/output.json index 85beda94d4..efadaa1833 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0001/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, - "value": "\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0", "extra": { - "raw": "\"\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0\"", - "rawValue": "\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0" - } + "rawValue": "\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0", + "raw": "\"\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0\"" + }, + "value": "\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0002/output.json index 4e09c13fd6..9fff89ab12 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0002/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, - "value": "\\\\u0061", "extra": { - "raw": "\"\\\\u0061\"", - "rawValue": "\\\\u0061" - } + "rawValue": "\\\\u0061", + "raw": "\"\\\\u0061\"" + }, + "value": "\\\\u0061" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0003/output.json index fb5e0996bf..54cc770503 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0003/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "value": "\\x61", "extra": { - "raw": "\"\\x61\"", - "rawValue": "\\x61" - } + "rawValue": "\\x61", + "raw": "\"\\x61\"" + }, + "value": "\\x61" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0006/output.json index 2bc5cf54b2..161f9e44f7 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0006/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, - "value": "Hello\\nworld", "extra": { - "raw": "\"Hello\\nworld\"", - "rawValue": "Hello\\nworld" - } + "rawValue": "Hello\\nworld", + "raw": "\"Hello\\nworld\"" + }, + "value": "Hello\\nworld" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0007/output.json index 8bbf441a1b..dbf4039b4e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0007/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, - "value": "Hello\\\nworld", "extra": { - "raw": "\"Hello\\\nworld\"", - "rawValue": "Hello\\\nworld" - } + "rawValue": "Hello\\\nworld", + "raw": "\"Hello\\\nworld\"" + }, + "value": "Hello\\\nworld" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0008/output.json index 7ba45ecc53..96777bab48 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0008/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, - "value": "Hello\\02World", "extra": { - "raw": "\"Hello\\02World\"", - "rawValue": "Hello\\02World" - } + "rawValue": "Hello\\02World", + "raw": "\"Hello\\02World\"" + }, + "value": "Hello\\02World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0009/output.json index 6ff8b0773c..aed791b605 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0009/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\012World", "extra": { - "raw": "\"Hello\\012World\"", - "rawValue": "Hello\\012World" - } + "rawValue": "Hello\\012World", + "raw": "\"Hello\\012World\"" + }, + "value": "Hello\\012World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0010/output.json index 43e794894e..5006e83a10 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0010/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\122World", "extra": { - "raw": "\"Hello\\122World\"", - "rawValue": "Hello\\122World" - } + "rawValue": "Hello\\122World", + "raw": "\"Hello\\122World\"" + }, + "value": "Hello\\122World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0011/output.json index e51d6f3e51..3262f09149 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0011/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, - "value": "Hello\\0122World", "extra": { - "raw": "\"Hello\\0122World\"", - "rawValue": "Hello\\0122World" - } + "rawValue": "Hello\\0122World", + "raw": "\"Hello\\0122World\"" + }, + "value": "Hello\\0122World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0012/output.json index 4dfa59a362..7b741d3ad0 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0012/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\312World", "extra": { - "raw": "\"Hello\\312World\"", - "rawValue": "Hello\\312World" - } + "rawValue": "Hello\\312World", + "raw": "\"Hello\\312World\"" + }, + "value": "Hello\\312World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0013/output.json index f7c0c7ae2f..be48a13c15 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0013/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\412World", "extra": { - "raw": "\"Hello\\412World\"", - "rawValue": "Hello\\412World" - } + "rawValue": "Hello\\412World", + "raw": "\"Hello\\412World\"" + }, + "value": "Hello\\412World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0015/output.json index 7ceb0644f6..a384cdbfcd 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0015/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "value": "Hello\\712World", "extra": { - "raw": "\"Hello\\712World\"", - "rawValue": "Hello\\712World" - } + "rawValue": "Hello\\712World", + "raw": "\"Hello\\712World\"" + }, + "value": "Hello\\712World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0016/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0016/output.json index 1a8fc198f2..bea9ab356e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0016/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0016/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, - "value": "Hello\\0World", "extra": { - "raw": "\"Hello\\0World\"", - "rawValue": "Hello\\0World" - } + "rawValue": "Hello\\0World", + "raw": "\"Hello\\0World\"" + }, + "value": "Hello\\0World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0017/output.json index 8bbf441a1b..dbf4039b4e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0017/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, - "value": "Hello\\\nworld", "extra": { - "raw": "\"Hello\\\nworld\"", - "rawValue": "Hello\\\nworld" - } + "rawValue": "Hello\\\nworld", + "raw": "\"Hello\\\nworld\"" + }, + "value": "Hello\\\nworld" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0018/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0018/output.json index b34917f7e6..480d402ced 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0018/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-string/migrated_0018/output.json @@ -14,11 +14,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, - "value": "Hello\\1World", "extra": { - "raw": "\"Hello\\1World\"", - "rawValue": "Hello\\1World" - } + "rawValue": "Hello\\1World", + "raw": "\"Hello\\1World\"" + }, + "value": "Hello\\1World" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0030/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0030/output.json index 2e6287a362..4f9a79b4fb 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0030/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0030/output.json @@ -77,11 +77,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0031/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0031/output.json index 31e2398fac..49222efa73 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0031/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0031/output.json @@ -81,11 +81,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0032/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0032/output.json index 2a1ff4f914..1410973ae5 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0032/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0032/output.json @@ -80,11 +80,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0033/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0033/output.json index a912cee466..d03f7a40d3 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0033/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0033/output.json @@ -86,11 +86,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "\"use strict\"" + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json index 72cd5ec5d5..67e07cd135 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { - "raw": "\"\\x\"", - "rawValue": "\\x" + "rawValue": "\\x", + "raw": "\"\\x\"" }, "value": "\\x" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json index 7f928cd1dd..e92647244d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "extra": { - "raw": "\"\\x0\"", - "rawValue": "\\x0" + "rawValue": "\\x0", + "raw": "\"\\x0\"" }, "value": "\\x0" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json index 2f085bc4ef..1b63d2209b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "extra": { - "raw": "\"\\xx\"", - "rawValue": "\\xx" + "rawValue": "\\xx", + "raw": "\"\\xx\"" }, "value": "\\xx" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json index fbc7576fdf..b907f8657e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { - "raw": "\"\\u\"", - "rawValue": "\\u" + "rawValue": "\\u", + "raw": "\"\\u\"" }, "value": "\\u" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json index ba29620802..04c20a6334 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "extra": { - "raw": "\"\\u0\"", - "rawValue": "\\u0" + "rawValue": "\\u0", + "raw": "\"\\u0\"" }, "value": "\\u0" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json index 8bec3a48c6..35f366ab00 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "extra": { - "raw": "\"\\ux\"", - "rawValue": "\\ux" + "rawValue": "\\ux", + "raw": "\"\\ux\"" }, "value": "\\ux" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json index ca6e0068be..51af14a113 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "extra": { - "raw": "\"\\u00\"", - "rawValue": "\\u00" + "rawValue": "\\u00", + "raw": "\"\\u00\"" }, "value": "\\u00" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json index ea6cf6a8b3..d5e43e9d4c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "extra": { - "raw": "\"\\u000\"", - "rawValue": "\\u000" + "rawValue": "\\u000", + "raw": "\"\\u000\"" }, "value": "\\u000" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json index 66b1f9ca63..72cdf26d30 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json @@ -21,10 +21,6 @@ "left": { "type": "BinaryExpression", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "left": { "type": "NumericLiteral", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, @@ -43,6 +39,10 @@ "raw": "1" }, "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json index ce1ff12dc0..15e8b8ebdb 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json @@ -17,10 +17,6 @@ "left": { "type": "BinaryExpression", "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, - "extra": { - "parenthesized": true, - "parenStart": 4 - }, "left": { "type": "NumericLiteral", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, @@ -39,6 +35,10 @@ "raw": "1" }, "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 4 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json index bbaa5f8517..088b494f12 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "Property", @@ -48,7 +44,11 @@ }, "shorthand": false } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json index 2c169917e7..b19fb01211 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json index 39a48ce279..32f80188d4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json index 35d22ba742..774a720780 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json index d0530400d0..d7107dbcd0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json index 60534b0002..02f24861eb 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json index cba6699ec1..231718edbd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json index 8f898cf7a2..0371c06360 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json index 657451b675..2aeb907a0c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json index 242bb03d55..7749e4bde1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json @@ -52,8 +52,8 @@ "type": "DirectiveLiteral", "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json index fa61b279c3..29ecc31971 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":19,"end":43,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":43}}, - "extra": { - "parenthesized": true, - "parenStart": 18 - }, "id": null, "generator": false, "async": false, @@ -54,6 +50,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json index 4390beac20..037c5e6826 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":19,"end":46,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":46}}, - "extra": { - "parenthesized": true, - "parenStart": 18 - }, "id": null, "generator": false, "async": false, @@ -54,6 +50,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json index 4a682d6c85..e16e8f8d1b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, - "extra": { - "parenthesized": true, - "parenStart": 18 - }, "id": null, "generator": false, "async": false, @@ -50,6 +46,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json index 9321eacbd5..5ad5e3a253 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, - "extra": { - "parenthesized": true, - "parenStart": 18 - }, "id": null, "generator": false, "async": false, @@ -50,6 +46,10 @@ } ], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json index 4eac4215e0..ec18a41c15 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json @@ -16,10 +16,6 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -55,8 +51,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } @@ -64,7 +60,11 @@ ] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json index 224e3d31eb..6e50ea1697 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json @@ -16,10 +16,6 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -53,8 +49,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } @@ -62,7 +58,11 @@ ] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json index 067b73ce53..5824ea0f73 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json @@ -59,8 +59,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json index 2d7204637a..bf1c3390af 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json @@ -59,8 +59,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json index 44484811f9..fe50f66a91 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json index dca567981b..5ec5d95b40 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json index 3338052138..932ad53e37 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json @@ -57,8 +57,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json index 3d1c7d7ebe..39f80928a3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json @@ -57,8 +57,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json index 5593bc5e19..941f1562ef 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json index 6b15ccd03e..fbcef97a83 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json index 35025e0c60..467e17681b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json index 5bead73e79..1c81cb944a 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json index 0b82488fd4..9910fc4ca6 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json index 9bbefb53c9..64880bbf36 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json index 58d6e13320..33e66b8292 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json index 0a859a25f4..daba68f0a5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json @@ -49,8 +49,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json index eacc05a4b0..27de7209a4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json @@ -52,8 +52,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json index 4fc4cfff5a..e3aaac026b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json @@ -52,8 +52,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json index fdc46d061d..2124c31099 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json index 7b1924caf1..7aef7b58af 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json index 48f9179f3b..d8d9a87930 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json @@ -31,10 +31,6 @@ "expression": { "type": "CallExpression", "start":33,"end":54,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":54}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "callee": { "type": "FunctionExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, @@ -53,7 +49,11 @@ "directives": [] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -65,8 +65,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json index 2d2f562d54..ef5dbc5819 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json @@ -31,10 +31,6 @@ "expression": { "type": "CallExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "callee": { "type": "FunctionExpression", "start":33,"end":57,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":57}}, @@ -53,7 +49,11 @@ "directives": [] } }, - "arguments": [] + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -65,8 +65,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json index 3c81b46822..835ee6d57f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json @@ -19,10 +19,6 @@ "callee": { "type": "FunctionExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"eval"}, @@ -43,13 +39,17 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json index 8e6c5c8943..e6673306c5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json @@ -19,10 +19,6 @@ "callee": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19},"identifierName":"arguments"}, @@ -43,13 +39,17 @@ "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json index 9229db313a..266ef0cac8 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectProperty", @@ -66,7 +62,11 @@ } } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -78,8 +78,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json index c5b8877683..b3267927ce 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json @@ -19,10 +19,6 @@ "callee": { "type": "FunctionExpression", "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"package"}, @@ -43,13 +39,17 @@ "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json index 47a65a4a93..c0979c1242 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectProperty", @@ -85,7 +81,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -97,8 +97,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json index 6f387fb201..97e2668793 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectMethod", @@ -64,7 +60,11 @@ "directives": [] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -76,8 +76,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json index 68a903fb4f..41b12f57d7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}}, - "extra": { - "parenthesized": true, - "parenStart": 32 - }, "properties": [ { "type": "ObjectProperty", @@ -72,7 +68,11 @@ } } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } } } ], @@ -84,8 +84,8 @@ "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json index 830edc82be..13972980b5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json index 232a3d3612..4e56622edb 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json index 9b32d2b448..19787e26dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json @@ -58,8 +58,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json index 7395b0a56a..f0a5a4d594 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json @@ -58,8 +58,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json index ba29c1ca0f..ee75ea8e74 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json @@ -18,8 +18,8 @@ "type": "DirectiveLiteral", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { - "raw": "\"\\1\"", - "rawValue": "\\1" + "rawValue": "\\1", + "raw": "\"\\1\"" }, "value": "\\1" } @@ -31,8 +31,8 @@ "type": "DirectiveLiteral", "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json index 268b23194b..210d1d46ab 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}}, "extra": { - "raw": "\"\\1\"", - "rawValue": "\\1" + "rawValue": "\\1", + "raw": "\"\\1\"" }, "value": "\\1" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json index dab3473097..1256393ff4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json @@ -47,8 +47,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json index 2be4810dff..4115ea4e32 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, - "extra": { - "parenthesized": true, - "parenStart": 33 - }, "properties": [ { "type": "ObjectProperty", @@ -61,7 +57,11 @@ "value": 42 } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 33 + } } } ], @@ -73,8 +73,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json index 7e92eeb15f..46c2311222 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json @@ -31,10 +31,6 @@ "expression": { "type": "ObjectExpression", "start":34,"end":45,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":45}}, - "extra": { - "parenthesized": true, - "parenStart": 33 - }, "properties": [ { "type": "ObjectProperty", @@ -61,7 +57,11 @@ "value": 42 } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 33 + } } } ], @@ -73,8 +73,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json index 810a2fe1c2..e85162b602 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":19,"end":38,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":38}}, "extra": { - "raw": "\"octal directive\\1\"", - "rawValue": "octal directive\\1" + "rawValue": "octal directive\\1", + "raw": "\"octal directive\\1\"" }, "value": "octal directive\\1" } @@ -46,8 +46,8 @@ "type": "DirectiveLiteral", "start":40,"end":52,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":52}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json index d454991b19..f70713cb1a 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json @@ -34,8 +34,8 @@ "type": "DirectiveLiteral", "start":19,"end":38,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":38}}, "extra": { - "raw": "\"octal directive\\1\"", - "rawValue": "octal directive\\1" + "rawValue": "octal directive\\1", + "raw": "\"octal directive\\1\"" }, "value": "octal directive\\1" } @@ -47,8 +47,8 @@ "type": "DirectiveLiteral", "start":40,"end":59,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":59}}, "extra": { - "raw": "\"octal directive\\2\"", - "rawValue": "octal directive\\2" + "rawValue": "octal directive\\2", + "raw": "\"octal directive\\2\"" }, "value": "octal directive\\2" } @@ -60,8 +60,8 @@ "type": "DirectiveLiteral", "start":61,"end":73,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":73}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json index 6a534cbb80..23953fa175 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":52,"end":71,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":71}}, "extra": { - "raw": "\"octal directive\\1\"", - "rawValue": "octal directive\\1" + "rawValue": "octal directive\\1", + "raw": "\"octal directive\\1\"" }, "value": "octal directive\\1" } @@ -66,8 +66,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json index 917c3e5a9e..81d51ffb9b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json index 98446531fa..6c46ff6503 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json index 4e1da8899d..f529b5daa3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json index 52b9164d1a..a6575e03a7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json index f7dbc7b74c..32835a520f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json index 5e4ded19fd..469235ed6d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json index 70f7e9670e..2a50605954 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json index 48dc58ff96..90a4f0c993 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json index a6dab52e93..9bb9f8187c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json @@ -51,8 +51,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json index fda02a2a3f..6cd9d958c9 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json index 7f3b58f78a..12d7c32962 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json @@ -33,8 +33,8 @@ "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json index 8689725c89..7cc292a49d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json index 7d2be8d578..7fb7ba344e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":24,"end":36,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":36}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json index 7feccdb115..1446d4a778 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json @@ -37,8 +37,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json index 3fba35b99d..3ae2bbc039 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json @@ -44,8 +44,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json index 55829c2b07..a9aed7a2dc 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json index b82f2cea47..a84cfbde62 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json @@ -39,8 +39,8 @@ "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json index 8cf993f513..8d6fb36639 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json @@ -67,8 +67,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json index 8f987f7098..345cb14aa3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -51,13 +47,17 @@ "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json index 688a01f586..097067ec9f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json @@ -31,10 +31,6 @@ "expression": { "type": "FunctionExpression", "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, - "extra": { - "parenthesized": true, - "parenStart": 29 - }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"b"}, @@ -59,6 +55,10 @@ "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 29 } } } @@ -71,8 +71,8 @@ "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json index 911fe15b76..d31f179278 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -46,13 +42,17 @@ "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json index 44b440b91f..5f7a585303 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json @@ -16,10 +16,6 @@ "expression": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -46,13 +42,17 @@ "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json index db0d9cecc3..8683f0da5f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json @@ -48,8 +48,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "\"use strict\"", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "\"use strict\"" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json index 69e2395bdd..f747de2aec 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json @@ -38,8 +38,8 @@ "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "extra": { - "raw": "'use strict'", - "rawValue": "use strict" + "rawValue": "use strict", + "raw": "'use strict'" }, "value": "use strict" } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0024/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0024/output.json index 2bf7aed2fc..9ba0211fad 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0024/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0024/output.json @@ -18,6 +18,7 @@ "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, + "computed": true, "property": { "type": "BinaryExpression", "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, @@ -32,8 +33,7 @@ "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"c"}, "name": "c" } - }, - "computed": true + } }, "right": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0025/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0025/output.json index 783531a212..fdc15c9f67 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0025/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0025/output.json @@ -39,6 +39,7 @@ } ] }, + "computed": true, "property": { "type": "NumericLiteral", "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, @@ -47,8 +48,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } }, "right": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0026/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0026/output.json index 0a0bb5e03a..417c685946 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0026/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0026/output.json @@ -18,12 +18,12 @@ "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":9,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":9},"identifierName":"in"}, "name": "in" - }, - "computed": false + } }, "right": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json b/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json index 3a51c1e9b7..a8870d0275 100644 --- a/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json +++ b/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "Property", @@ -48,7 +44,11 @@ }, "shorthand": false } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ] diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-chained-member/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-chained-member/output.json index 9369e8f489..ece6aef57b 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-chained-member/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-chained-member/output.json @@ -27,12 +27,12 @@ "optional": true, "arguments": [] }, + "computed": false, "property": { "type": "Identifier", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": false } } diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-member/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-member/output.json index 0fe7f00909..f7612792c3 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-member/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-member/output.json @@ -32,12 +32,12 @@ "parenStart": 0 } }, + "computed": false, "property": { "type": "Identifier", "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": false } } diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-optional-member/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-optional-member/output.json index e80ce5e918..3cc0eab15b 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-optional-member/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-call-optional-member/output.json @@ -27,12 +27,12 @@ "optional": true, "arguments": [] }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-call/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-call/output.json index 71ea0bec2f..a415691c17 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-call/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-call/output.json @@ -24,12 +24,12 @@ "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true }, "extra": { diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-chained-call/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-chained-call/output.json index b09b5792ae..1ff6e08389 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-chained-call/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-chained-call/output.json @@ -24,12 +24,12 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true }, "optional": false, diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-chained-member/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-chained-member/output.json index ad36a4f6b3..2c5705655b 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-chained-member/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-chained-member/output.json @@ -24,20 +24,20 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"qux"}, "name": "qux" }, - "computed": false, "optional": false } } diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-member/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-member/output.json index 0e9d26ac4e..0cf325f435 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-member/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-member/output.json @@ -24,12 +24,12 @@ "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true }, "extra": { @@ -37,12 +37,12 @@ "parenStart": 0 } }, + "computed": false, "property": { "type": "Identifier", "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"qux"}, "name": "qux" }, - "computed": false, "optional": false } } diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-optional-call/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-optional-call/output.json index c6d55b054a..30bb481a04 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-optional-call/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-optional-call/output.json @@ -24,12 +24,12 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true }, "optional": true, diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-optional-member/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-optional-member/output.json index 0bbc058549..850cfaa11a 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-optional-member/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member-optional-member/output.json @@ -24,20 +24,20 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"qux"}, "name": "qux" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member/output.json b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member/output.json index 2429cf521f..e1b865822c 100644 --- a/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member/output.json +++ b/packages/babel-parser/test/fixtures/estree/optional-chaining/optional-member/output.json @@ -21,12 +21,12 @@ "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "Identifier", "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"bar"}, "name": "bar" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json b/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json index d1d64c9ddb..082457acc2 100644 --- a/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json +++ b/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json @@ -17,10 +17,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "Property", @@ -55,7 +51,11 @@ }, "shorthand": false } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } }, { @@ -64,10 +64,6 @@ "expression": { "type": "ObjectExpression", "start":22,"end":46,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":25}}, - "extra": { - "parenthesized": true, - "parenStart": 21 - }, "properties": [ { "type": "Property", @@ -107,7 +103,11 @@ }, "shorthand": false } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 21 + } } }, { @@ -116,10 +116,6 @@ "expression": { "type": "ObjectExpression", "start":50,"end":64,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":15}}, - "extra": { - "parenthesized": true, - "parenStart": 49 - }, "properties": [ { "type": "Property", @@ -148,7 +144,11 @@ }, "shorthand": false } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 49 + } } }, { @@ -157,10 +157,6 @@ "expression": { "type": "ObjectExpression", "start":68,"end":83,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":16}}, - "extra": { - "parenthesized": true, - "parenStart": 67 - }, "properties": [ { "type": "Property", @@ -195,7 +191,11 @@ }, "shorthand": false } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 67 + } } } ] diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-arrow-function-in-static-block copy/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-arrow-function-in-static-block copy/output.json index b6b10678a8..0c7e24fcd0 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-arrow-function-in-static-block copy/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-arrow-function-in-static-block copy/output.json @@ -10,13 +10,6 @@ { "type": "VariableDeclaration", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " await in body is allowed", - "start":7,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}} - } - ], "declarations": [ { "type": "VariableDeclarator", @@ -29,18 +22,18 @@ "init": null } ], - "kind": "var" - }, - { - "type": "ExpressionStatement", - "start":35,"end":72,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":37}}, - "leadingComments": [ + "kind": "var", + "trailingComments": [ { "type": "CommentLine", "value": " await in body is allowed", "start":7,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":35,"end":72,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":37}}, "expression": { "type": "AssignmentExpression", "start":35,"end":71,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}}, @@ -85,7 +78,14 @@ ] } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " await in body is allowed", + "start":7,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-async-arrow-function-in-static-block/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-async-arrow-function-in-static-block/output.json index ec2e6a8f51..f0e2de8e6c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-async-arrow-function-in-static-block/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-async-arrow-function-in-static-block/output.json @@ -15,13 +15,6 @@ { "type": "VariableDeclaration", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " await is not allowed in async arrow", - "start":7,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}} - } - ], "declarations": [ { "type": "VariableDeclarator", @@ -34,18 +27,18 @@ "init": null } ], - "kind": "var" - }, - { - "type": "ExpressionStatement", - "start":46,"end":91,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":45}}, - "leadingComments": [ + "kind": "var", + "trailingComments": [ { "type": "CommentLine", "value": " await is not allowed in async arrow", "start":7,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":46,"end":91,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":45}}, "expression": { "type": "AssignmentExpression", "start":46,"end":90,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":44}}, @@ -97,7 +90,14 @@ ] } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " await is not allowed in async arrow", + "start":7,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}} + } + ] }, { "type": "ExpressionStatement", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-function-in-static-block/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-function-in-static-block/output.json index c0b1913d15..d17a51d03c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-function-in-static-block/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-function-in-static-block/output.json @@ -208,13 +208,6 @@ { "type": "ExpressionStatement", "start":158,"end":213,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":55}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " await in function expression is allowed", - "start":214,"end":256,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":42}} - } - ], "expression": { "type": "AssignmentExpression", "start":158,"end":212,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":54}}, @@ -284,18 +277,18 @@ ] } } - } - }, - { - "type": "ExpressionStatement", - "start":257,"end":304,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":47}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " await in function expression is allowed", "start":214,"end":256,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":42}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":257,"end":304,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":47}}, "expression": { "type": "AssignmentExpression", "start":257,"end":303,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":46}}, @@ -324,10 +317,6 @@ "expression": { "type": "FunctionExpression", "start":279,"end":298,"loc":{"start":{"line":11,"column":22},"end":{"line":11,"column":41}}, - "extra": { - "parenthesized": true, - "parenStart": 278 - }, "id": { "type": "Identifier", "start":288,"end":293,"loc":{"start":{"line":11,"column":31},"end":{"line":11,"column":36},"identifierName":"await"}, @@ -341,6 +330,10 @@ "start":296,"end":298,"loc":{"start":{"line":11,"column":39},"end":{"line":11,"column":41}}, "body": [], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 278 } } } @@ -349,7 +342,14 @@ ] } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " await in function expression is allowed", + "start":214,"end":256,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":42}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json index ce70f8312e..901e57701a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json @@ -26,13 +26,6 @@ { "type": "VariableDeclaration", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " This file enumerates all the disallowed cases, for allowed cases, see await-binding-*", - "start":7,"end":95,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":88}} - } - ], "declarations": [ { "type": "VariableDeclarator", @@ -45,18 +38,18 @@ "init": null } ], - "kind": "var" - }, - { - "type": "ExpressionStatement", - "start":96,"end":127,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":31}}, - "leadingComments": [ + "kind": "var", + "trailingComments": [ { "type": "CommentLine", "value": " This file enumerates all the disallowed cases, for allowed cases, see await-binding-*", "start":7,"end":95,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":88}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":96,"end":127,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":31}}, "expression": { "type": "AssignmentExpression", "start":96,"end":126,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":30}}, @@ -93,7 +86,14 @@ ] } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " This file enumerates all the disallowed cases, for allowed cases, see await-binding-*", + "start":7,"end":95,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":88}} + } + ] }, { "type": "ExpressionStatement", @@ -126,11 +126,11 @@ "expression": { "type": "Identifier", "start":151,"end":156,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":27},"identifierName":"await"}, + "name": "await", "extra": { "parenthesized": true, "parenStart": 150 - }, - "name": "await" + } } } ] @@ -265,13 +265,6 @@ { "type": "ExpressionStatement", "start":254,"end":299,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":45}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " await as label is not allowed", - "start":300,"end":332,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":32}} - } - ], "expression": { "type": "ArrowFunctionExpression", "start":254,"end":298,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":44}}, @@ -322,18 +315,18 @@ "body": [], "directives": [] } - } - }, - { - "type": "ExpressionStatement", - "start":333,"end":367,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":34}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " await as label is not allowed", "start":300,"end":332,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":32}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":333,"end":367,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":34}}, "expression": { "type": "AssignmentExpression", "start":333,"end":366,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":33}}, @@ -383,18 +376,18 @@ ] } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " await as label is not allowed", + "start":300,"end":332,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":32}} + } + ] }, { "type": "ExpressionStatement", "start":369,"end":414,"loc":{"start":{"line":15,"column":0},"end":{"line":15,"column":45}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " await binding in function declaration is not allowed", - "start":415,"end":470,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":55}} - } - ], "expression": { "type": "AssignmentExpression", "start":369,"end":413,"loc":{"start":{"line":15,"column":0},"end":{"line":15,"column":44}}, @@ -450,25 +443,18 @@ ] } } - } - }, - { - "type": "ExpressionStatement", - "start":471,"end":516,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":45}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " await binding in function declaration is not allowed", "start":415,"end":470,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":55}} } - ], - "trailingComments": [ - { - "type": "CommentLine", - "value": " await binding in class declaration is not allowed", - "start":517,"end":569,"loc":{"start":{"line":18,"column":0},"end":{"line":18,"column":52}} - } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":471,"end":516,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":45}}, "expression": { "type": "AssignmentExpression", "start":471,"end":515,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":44}}, @@ -514,25 +500,25 @@ ] } } - } - }, - { - "type": "ExpressionStatement", - "start":570,"end":610,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":40}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " await binding in class declaration is not allowed", "start":517,"end":569,"loc":{"start":{"line":18,"column":0},"end":{"line":18,"column":52}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " await binding in class expression is not allowed", - "start":611,"end":662,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":51}} + "value": " await binding in function declaration is not allowed", + "start":415,"end":470,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":55}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":570,"end":610,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":40}}, "expression": { "type": "AssignmentExpression", "start":570,"end":609,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":39}}, @@ -575,25 +561,25 @@ ] } } - } - }, - { - "type": "ExpressionStatement", - "start":663,"end":705,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":42}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " await binding in class expression is not allowed", "start":611,"end":662,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":51}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " await in arrow parameters is not allowed", - "start":706,"end":749,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":43}} + "value": " await binding in class declaration is not allowed", + "start":517,"end":569,"loc":{"start":{"line":18,"column":0},"end":{"line":18,"column":52}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":663,"end":705,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":42}}, "expression": { "type": "AssignmentExpression", "start":663,"end":704,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":41}}, @@ -622,10 +608,6 @@ "expression": { "type": "ClassExpression", "start":685,"end":699,"loc":{"start":{"line":21,"column":22},"end":{"line":21,"column":36}}, - "extra": { - "parenthesized": true, - "parenStart": 684 - }, "id": { "type": "Identifier", "start":691,"end":696,"loc":{"start":{"line":21,"column":28},"end":{"line":21,"column":33},"identifierName":"await"}, @@ -636,6 +618,10 @@ "type": "ClassBody", "start":697,"end":699,"loc":{"start":{"line":21,"column":34},"end":{"line":21,"column":36}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 684 } } } @@ -644,18 +630,25 @@ ] } } - } - }, - { - "type": "ExpressionStatement", - "start":750,"end":789,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":39}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " await in arrow parameters is not allowed", "start":706,"end":749,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":43}} } ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " await binding in class expression is not allowed", + "start":611,"end":662,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":51}} + } + ] + }, + { + "type": "ExpressionStatement", + "start":750,"end":789,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":39}}, "expression": { "type": "AssignmentExpression", "start":750,"end":788,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":38}}, @@ -707,7 +700,14 @@ ] } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " await in arrow parameters is not allowed", + "start":706,"end":749,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":43}} + } + ] }, { "type": "ExpressionStatement", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/directive-like-literal/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/directive-like-literal/output.json index 09da3453e2..72cb190ad7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/directive-like-literal/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/directive-like-literal/output.json @@ -49,13 +49,6 @@ { "type": "ExpressionStatement", "start":43,"end":56,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":17}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " will not be parsed as directives", - "start":57,"end":92,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":53}} - } - ], "expression": { "type": "StringLiteral", "start":43,"end":55,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":16}}, @@ -64,18 +57,18 @@ "raw": "\"use strict\"" }, "value": "use strict" - } - }, - { - "type": "ExpressionStatement", - "start":97,"end":117,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":24}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " will not be parsed as directives", "start":57,"end":92,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":53}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":97,"end":117,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":24}}, "expression": { "type": "AssignmentExpression", "start":97,"end":116,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":23}}, @@ -108,7 +101,14 @@ "name": "foo" } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " will not be parsed as directives", + "start":57,"end":92,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":53}} + } + ] } ] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/parenthesized/output.json index ba7832ad27..cf5f51b3cf 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/parenthesized/output.json @@ -27,12 +27,12 @@ }, "arguments": [] }, + "computed": false, "property": { "type": "Identifier", "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } } } ], @@ -61,12 +61,12 @@ "start":29,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":10},"identifierName":"member"}, "name": "member" }, + "computed": true, "property": { "type": "Identifier", "start":36,"end":46,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":21},"identifierName":"expression"}, "name": "expression" - }, - "computed": true + } } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/output.json index 153a2fef0a..13ef3dc779 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/output.json @@ -35,12 +35,12 @@ "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"foo"}, "name": "foo" }, + "computed": true, "property": { "type": "Identifier", "start":19,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10},"identifierName":"bar"}, "name": "bar" - }, - "computed": true + } } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expression/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expression/output.json index 3d9bf0eb29..28ce96be29 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expression/output.json @@ -35,12 +35,12 @@ "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"bar"}, "name": "bar" }, + "computed": true, "property": { "type": "Identifier", "start":19,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11},"identifierName":"bizz"}, "name": "bizz" - }, - "computed": true + } } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/do-expressions/with-jsx/output.json b/packages/babel-parser/test/fixtures/experimental/do-expressions/with-jsx/output.json index cff7b87dc7..f76f560ce9 100644 --- a/packages/babel-parser/test/fixtures/experimental/do-expressions/with-jsx/output.json +++ b/packages/babel-parser/test/fixtures/experimental/do-expressions/with-jsx/output.json @@ -28,10 +28,6 @@ "argument": { "type": "JSXElement", "start":32,"end":216,"loc":{"start":{"line":3,"column":4},"end":{"line":14,"column":10}}, - "extra": { - "parenthesized": true, - "parenStart": 26 - }, "openingElement": { "type": "JSXOpeningElement", "start":32,"end":37,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}}, @@ -178,7 +174,11 @@ }, "value": "\n " } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 26 + } } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/call-on-SuperProperty/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/call-on-SuperProperty/output.json index b6196e69a2..11141c48f2 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/call-on-SuperProperty/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/call-on-SuperProperty/output.json @@ -72,12 +72,12 @@ "type": "Super", "start":56,"end":61,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":29}} }, + "computed": false, "property": { "type": "Identifier", "start":62,"end":65,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":33},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/for-any-arg/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/for-any-arg/output.json index dd58d9538a..404b3d9fed 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/for-any-arg/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/for-any-arg/output.json @@ -49,12 +49,12 @@ "start":12,"end":15,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"bar"}, "name": "bar" }, + "computed": false, "property": { "type": "Identifier", "start":16,"end":19,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/from-left/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/from-left/output.json index 50b9590533..f30edcfe0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/from-left/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/from-left/output.json @@ -45,12 +45,12 @@ "start":10,"end":13,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"bar"}, "name": "bar" }, + "computed": false, "property": { "type": "Identifier", "start":14,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/from-right/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/from-right/output.json index fec2b9a606..3b0ec7cab5 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/from-right/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/from-right/output.json @@ -45,12 +45,12 @@ "start":10,"end":13,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"bar"}, "name": "bar" }, + "computed": false, "property": { "type": "Identifier", "start":14,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-arrow-function-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-arrow-function-parenthesized/output.json index 3bb77cf7bf..8b9ed70275 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-arrow-function-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-arrow-function-parenthesized/output.json @@ -22,10 +22,6 @@ "right": { "type": "ArrowFunctionExpression", "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - }, "id": null, "generator": false, "async": false, @@ -47,6 +43,10 @@ }, "value": 1 } + }, + "extra": { + "parenthesized": true, + "parenStart": 9 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-assignment-to-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-assignment-to-topic/output.json index 34b61d929f..f0d6059948 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-assignment-to-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-assignment-to-topic/output.json @@ -25,10 +25,6 @@ "right": { "type": "AssignmentExpression", "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - }, "operator": "=", "left": { "type": "TopicReference", @@ -42,6 +38,10 @@ "raw": "1" }, "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 9 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-class-expression-with-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-class-expression-with-decorators/output.json index 5f6fe6d44c..f43f7b4588 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-class-expression-with-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-class-expression-with-decorators/output.json @@ -25,10 +25,6 @@ "callee": { "type": "ClassExpression", "start":17,"end":127,"loc":{"start":{"line":2,"column":2},"end":{"line":8,"column":3}}, - "extra": { - "parenthesized": true, - "parenStart": 13 - }, "decorators": [ { "type": "Decorator", @@ -112,6 +108,10 @@ } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 13 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-class-expression-with-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-class-expression-with-private-property/output.json index f6c7e7a65d..27240bf940 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-class-expression-with-private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-class-expression-with-private-property/output.json @@ -25,10 +25,6 @@ "callee": { "type": "ClassExpression", "start":14,"end":92,"loc":{"start":{"line":1,"column":14},"end":{"line":7,"column":1}}, - "extra": { - "parenthesized": true, - "parenStart": 13 - }, "id": { "type": "Identifier", "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"Thing"}, @@ -109,6 +105,10 @@ } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 13 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-comma-topic-pair/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-comma-topic-pair/output.json index 12c0cb49ed..3ff2e7e2b0 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-comma-topic-pair/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-comma-topic-pair/output.json @@ -26,10 +26,6 @@ "right": { "type": "SequenceExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "expressions": [ { "type": "TopicReference", @@ -39,7 +35,11 @@ "type": "TopicReference", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}} } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json index e04f68fe79..6e25492ccb 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json @@ -25,10 +25,6 @@ "right": { "type": "ArrowFunctionExpression", "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "id": null, "generator": false, "async": false, @@ -66,6 +62,10 @@ "value": 1 } } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-with-function-call/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-with-function-call/output.json index 12c2619c00..352f7eef1b 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-with-function-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-with-function-call/output.json @@ -22,10 +22,6 @@ "right": { "type": "BinaryExpression", "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "left": { "type": "TopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -50,6 +46,10 @@ "name": "x" } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-without-inner-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-without-inner-topic/output.json index fd53f606c9..787d6e99ae 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-without-inner-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-nested-pipelines-without-inner-topic/output.json @@ -25,10 +25,6 @@ "right": { "type": "BinaryExpression", "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "left": { "type": "TopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -43,6 +39,10 @@ "name": "f" }, "arguments": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-yield-generator-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-yield-generator-parenthesized/output.json index e9e11c6eef..8ef6db70fa 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-yield-generator-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-hash-proposal-yield-generator-parenthesized/output.json @@ -43,14 +43,14 @@ "right": { "type": "YieldExpression", "start":34,"end":41,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, - "extra": { - "parenthesized": true, - "parenStart": 33 - }, "delegate": false, "argument": { "type": "TopicReference", "start":40,"end":41,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}} + }, + "extra": { + "parenthesized": true, + "parenStart": 33 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-arrow-function-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-arrow-function-parenthesized/output.json index 3bb77cf7bf..8b9ed70275 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-arrow-function-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-arrow-function-parenthesized/output.json @@ -22,10 +22,6 @@ "right": { "type": "ArrowFunctionExpression", "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - }, "id": null, "generator": false, "async": false, @@ -47,6 +43,10 @@ }, "value": 1 } + }, + "extra": { + "parenthesized": true, + "parenStart": 9 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-assignment-to-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-assignment-to-topic/output.json index 34b61d929f..f0d6059948 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-assignment-to-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-assignment-to-topic/output.json @@ -25,10 +25,6 @@ "right": { "type": "AssignmentExpression", "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - }, "operator": "=", "left": { "type": "TopicReference", @@ -42,6 +38,10 @@ "raw": "1" }, "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 9 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-class-expression-with-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-class-expression-with-decorators/output.json index 5f6fe6d44c..f43f7b4588 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-class-expression-with-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-class-expression-with-decorators/output.json @@ -25,10 +25,6 @@ "callee": { "type": "ClassExpression", "start":17,"end":127,"loc":{"start":{"line":2,"column":2},"end":{"line":8,"column":3}}, - "extra": { - "parenthesized": true, - "parenStart": 13 - }, "decorators": [ { "type": "Decorator", @@ -112,6 +108,10 @@ } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 13 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-class-expression-with-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-class-expression-with-private-property/output.json index f6c7e7a65d..27240bf940 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-class-expression-with-private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-class-expression-with-private-property/output.json @@ -25,10 +25,6 @@ "callee": { "type": "ClassExpression", "start":14,"end":92,"loc":{"start":{"line":1,"column":14},"end":{"line":7,"column":1}}, - "extra": { - "parenthesized": true, - "parenStart": 13 - }, "id": { "type": "Identifier", "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"Thing"}, @@ -109,6 +105,10 @@ } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 13 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-comma-topic-pair/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-comma-topic-pair/output.json index 12c0cb49ed..3ff2e7e2b0 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-comma-topic-pair/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-comma-topic-pair/output.json @@ -26,10 +26,6 @@ "right": { "type": "SequenceExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "expressions": [ { "type": "TopicReference", @@ -39,7 +35,11 @@ "type": "TopicReference", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}} } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-modulo-assignment-with-spaces/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-modulo-assignment-with-spaces/output.json index 94ab834b16..8cd63cbc9b 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-modulo-assignment-with-spaces/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-modulo-assignment-with-spaces/output.json @@ -22,10 +22,6 @@ "right": { "type": "AssignmentExpression", "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - }, "operator": "%=", "left": { "type": "Identifier", @@ -35,6 +31,10 @@ "right": { "type": "TopicReference", "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}} + }, + "extra": { + "parenthesized": true, + "parenStart": 9 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-modulo-assignment-without-spaces/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-modulo-assignment-without-spaces/output.json index e9a58291fe..268e1c5dcf 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-modulo-assignment-without-spaces/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-modulo-assignment-without-spaces/output.json @@ -22,10 +22,6 @@ "right": { "type": "AssignmentExpression", "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - }, "operator": "%=", "left": { "type": "Identifier", @@ -35,6 +31,10 @@ "right": { "type": "TopicReference", "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}} + }, + "extra": { + "parenthesized": true, + "parenStart": 9 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json index e04f68fe79..6e25492ccb 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json @@ -25,10 +25,6 @@ "right": { "type": "ArrowFunctionExpression", "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "id": null, "generator": false, "async": false, @@ -66,6 +62,10 @@ "value": 1 } } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-with-function-call/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-with-function-call/output.json index 12c2619c00..352f7eef1b 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-with-function-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-with-function-call/output.json @@ -22,10 +22,6 @@ "right": { "type": "BinaryExpression", "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "left": { "type": "TopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -50,6 +46,10 @@ "name": "x" } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-without-inner-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-without-inner-topic/output.json index fd53f606c9..787d6e99ae 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-without-inner-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-nested-pipelines-without-inner-topic/output.json @@ -25,10 +25,6 @@ "right": { "type": "BinaryExpression", "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "left": { "type": "TopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -43,6 +39,10 @@ "name": "f" }, "arguments": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-unbound-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-unbound-topic/output.json index 9b2253f1b1..3146682dd7 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-unbound-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-unbound-topic/output.json @@ -35,4 +35,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-yield-generator-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-yield-generator-parenthesized/output.json index e9e11c6eef..8ef6db70fa 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-yield-generator-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-percent-proposal-yield-generator-parenthesized/output.json @@ -43,14 +43,14 @@ "right": { "type": "YieldExpression", "start":34,"end":41,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, - "extra": { - "parenthesized": true, - "parenStart": 33 - }, "delegate": false, "argument": { "type": "TopicReference", "start":40,"end":41,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}} + }, + "extra": { + "parenthesized": true, + "parenStart": 33 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/output.json index c52d6a6960..c6606b33e1 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/output.json @@ -25,10 +25,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - }, "id": null, "generator": false, "async": false, @@ -50,6 +46,10 @@ }, "value": 1 } + }, + "extra": { + "parenthesized": true, + "parenStart": 9 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-class-expression-with-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-class-expression-with-decorators/output.json index aa2d2b3b5e..7b69ae0ebf 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-class-expression-with-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-class-expression-with-decorators/output.json @@ -32,10 +32,6 @@ "callee": { "type": "ClassExpression", "start":17,"end":127,"loc":{"start":{"line":2,"column":2},"end":{"line":8,"column":3}}, - "extra": { - "parenthesized": true, - "parenStart": 13 - }, "decorators": [ { "type": "Decorator", @@ -119,6 +115,10 @@ } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 13 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-class-expression-with-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-class-expression-with-private-property/output.json index e8c0f1ae04..670afae76d 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-class-expression-with-private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-class-expression-with-private-property/output.json @@ -32,10 +32,6 @@ "callee": { "type": "ClassExpression", "start":14,"end":92,"loc":{"start":{"line":1,"column":14},"end":{"line":7,"column":1}}, - "extra": { - "parenthesized": true, - "parenStart": 13 - }, "id": { "type": "Identifier", "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"Thing"}, @@ -116,6 +112,10 @@ } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 13 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-head-with-tacit-function-call/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-head-with-tacit-function-call/output.json index 5cf158b587..ba4e2915d7 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-head-with-tacit-function-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-head-with-tacit-function-call/output.json @@ -19,10 +19,6 @@ "left": { "type": "SequenceExpression", "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "expressions": [ { "type": "NumericLiteral", @@ -42,7 +38,11 @@ }, "value": 2 } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } }, "operator": "|>", "right": { diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-topic-pair-then-end/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-topic-pair-then-end/output.json index dd794f84e9..a908d0c3a0 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-topic-pair-then-end/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-topic-pair-then-end/output.json @@ -29,10 +29,6 @@ "expression": { "type": "SequenceExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "expressions": [ { "type": "PipelinePrimaryTopicReference", @@ -42,7 +38,11 @@ "type": "PipelinePrimaryTopicReference", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}} } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-topic-pair-then-tacit-function-call/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-topic-pair-then-tacit-function-call/output.json index 13532fa8ed..ebffb097bb 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-topic-pair-then-tacit-function-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-comma-topic-pair-then-tacit-function-call/output.json @@ -32,10 +32,6 @@ "expression": { "type": "SequenceExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "expressions": [ { "type": "PipelinePrimaryTopicReference", @@ -45,7 +41,11 @@ "type": "PipelinePrimaryTopicReference", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}} } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } } } }, diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-generator-yield-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-generator-yield-parenthesized/output.json index 2350a5393f..f0d02e0b12 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-generator-yield-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-generator-yield-parenthesized/output.json @@ -46,14 +46,14 @@ "expression": { "type": "YieldExpression", "start":34,"end":41,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, - "extra": { - "parenthesized": true, - "parenStart": 33 - }, "delegate": false, "argument": { "type": "PipelinePrimaryTopicReference", "start":40,"end":41,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}} + }, + "extra": { + "parenthesized": true, + "parenStart": 33 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-function-call/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-function-call/output.json index 63b9f1f244..c110c8d178 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-function-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-function-call/output.json @@ -25,10 +25,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "id": null, "generator": false, "async": false, @@ -71,6 +67,10 @@ ] } } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-tacit-function-call-with-outer-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-tacit-function-call-with-outer-topic/output.json index 2d6e9d4391..2aeb5206b5 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-tacit-function-call-with-outer-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-tacit-function-call-with-outer-topic/output.json @@ -25,10 +25,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "id": null, "generator": false, "async": false, @@ -50,6 +46,10 @@ "name": "f" } } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-tacit-function-call-without-outer-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-tacit-function-call-without-outer-topic/output.json index 58b07efb5a..b0284fb3da 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-tacit-function-call-without-outer-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-and-tacit-function-call-without-outer-topic/output.json @@ -28,10 +28,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "id": null, "generator": false, "async": false, @@ -60,6 +56,10 @@ "name": "f" } } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-with-required-topics/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-with-required-topics/output.json index 094803f514..48777cb1b7 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-with-required-topics/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-with-required-topics/output.json @@ -25,10 +25,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":32,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":32}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "id": null, "generator": false, "async": false, @@ -98,6 +94,10 @@ } } } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json index 0a12a16ad6..a7ae8946eb 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json @@ -28,10 +28,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "id": null, "generator": false, "async": false, @@ -73,6 +69,10 @@ } } } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json index 0f4ff29592..fa03b8cb37 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json @@ -28,10 +28,6 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "id": null, "generator": false, "async": false, @@ -59,6 +55,10 @@ "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-function-call/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-function-call/output.json index 850c276d29..a2fd989f47 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-function-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-function-call/output.json @@ -25,10 +25,6 @@ "expression": { "type": "BinaryExpression", "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "left": { "type": "PipelinePrimaryTopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -57,6 +53,10 @@ } ] } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-tacit-function-call/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-tacit-function-call/output.json index 9e827bd22c..4259a597ed 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-tacit-function-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-tacit-function-call/output.json @@ -25,10 +25,6 @@ "expression": { "type": "BinaryExpression", "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "left": { "type": "PipelinePrimaryTopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -42,6 +38,10 @@ "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/output.json index 76621d804b..146b756602 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/output.json @@ -28,10 +28,6 @@ "expression": { "type": "BinaryExpression", "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "left": { "type": "PipelinePrimaryTopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -50,6 +46,10 @@ }, "arguments": [] } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/output.json index 3d5dd55ce1..b5c27ce3d1 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/output.json @@ -28,10 +28,6 @@ "expression": { "type": "BinaryExpression", "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 5 - }, "left": { "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, @@ -46,6 +42,10 @@ "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json index 417fcefef9..31d7d07df1 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json @@ -74,14 +74,14 @@ "left": { "type": "PrivateName", "start":38,"end":40,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":7}}, - "extra": { - "parenthesized": true, - "parenStart": 37 - }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":7},"identifierName":"x"}, "name": "x" + }, + "extra": { + "parenthesized": true, + "parenStart": 37 } }, "operator": "in", diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/trailing-comma-comments/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/trailing-comma-comments/output.json index e4a0c1abad..9d99ac0dba 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/trailing-comma-comments/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/trailing-comma-comments/output.json @@ -20,14 +20,14 @@ { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, + "name": "a", "trailingComments": [ { "type": "CommentBlock", "value": " 1 ", "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}} } - ], - "name": "a" + ] } ] } @@ -38,23 +38,10 @@ "expression": { "type": "RecordExpression", "start":14,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, - "extra": { - "trailingComma": 18 - }, "properties": [ { "type": "ObjectProperty", "start":17,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4}}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": " 1 ", - "start":19,"end":26,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":12}} - } - ], - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -67,9 +54,22 @@ "type": "Identifier", "start":17,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"a"}, "name": "a" - } + }, + "extra": { + "shorthand": true + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " 1 ", + "start":19,"end":26,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":12}} + } + ] } - ] + ], + "extra": { + "trailingComma": 18 + } } } ], diff --git a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-1/output.json b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-1/output.json index 99b5c40cf3..3171db6c62 100644 --- a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-1/output.json @@ -13,13 +13,6 @@ { "type": "ExpressionStatement", "start":43,"end":67,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Function which looks like a return type", - "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} - } - ], "expression": { "type": "ConditionalExpression", "start":43,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, @@ -31,11 +24,11 @@ "consequent": { "type": "Identifier", "start":48,"end":49,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, + "name": "b", "extra": { "parenthesized": true, "parenStart": 47 - }, - "name": "b" + } }, "alternate": { "type": "ArrowFunctionExpression", @@ -70,7 +63,14 @@ "name": "e" } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Function which looks like a return type", + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-2/output.json b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-2/output.json index 89889f8f6f..7eaa84e937 100644 --- a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-2/output.json @@ -13,13 +13,6 @@ { "type": "ExpressionStatement", "start":47,"end":83,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter after type parameters", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} - } - ], "expression": { "type": "ConditionalExpression", "start":47,"end":82,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, @@ -73,11 +66,11 @@ "body": { "type": "Identifier", "start":71,"end":72,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25},"identifierName":"e"}, + "name": "e", "extra": { "parenthesized": true, "parenStart": 70 - }, - "name": "e" + } }, "typeParameters": { "type": "TypeParameterDeclaration", @@ -111,7 +104,14 @@ "name": "g" } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter after type parameters", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-3/output.json b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-3/output.json index 8674cdbad9..29a6212099 100644 --- a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-3/output.json @@ -13,13 +13,6 @@ { "type": "ExpressionStatement", "start":47,"end":76,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter after type parameters", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} - } - ], "expression": { "type": "ConditionalExpression", "start":47,"end":75,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, @@ -58,11 +51,11 @@ "body": { "type": "Identifier", "start":64,"end":65,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"e"}, + "name": "e", "extra": { "parenthesized": true, "parenStart": 63 - }, - "name": "e" + } } }, "alternate": { @@ -84,7 +77,14 @@ "name": "g" } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter after type parameters", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-4/output.json b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-4/output.json index dba5be30eb..d32e8ba5d4 100644 --- a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58-failing-4/output.json @@ -13,13 +13,6 @@ { "type": "ExpressionStatement", "start":25,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter", - "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}} - } - ], "expression": { "type": "ConditionalExpression", "start":25,"end":59,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, @@ -58,11 +51,11 @@ "body": { "type": "Identifier", "start":48,"end":49,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":24},"identifierName":"d"}, + "name": "d", "extra": { "parenthesized": true, "parenStart": 47 - }, - "name": "d" + } } }, "alternate": { @@ -84,7 +77,14 @@ "name": "g" } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter", + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58/output.json b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58/output.json index 6b7fae1bf6..3f92e3e829 100644 --- a/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58/output.json +++ b/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-58/output.json @@ -10,20 +10,6 @@ { "type": "ExpressionStatement", "start":38,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Valid lhs value inside parentheses", - "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}} - } - ], - "trailingComments": [ - { - "type": "CommentLine", - "value": " a ? b : (c => d)", - "start":56,"end":75,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":37}} - } - ], "expression": { "type": "ConditionalExpression", "start":38,"end":54,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, @@ -35,11 +21,11 @@ "consequent": { "type": "Identifier", "start":43,"end":44,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, + "name": "b", "extra": { "parenthesized": true, "parenStart": 42 - }, - "name": "b" + } }, "alternate": { "type": "ArrowFunctionExpression", @@ -60,25 +46,25 @@ "name": "d" } } - } - }, - { - "type": "ExpressionStatement", - "start":76,"end":97,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? b : (c => d)", "start":56,"end":75,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":37}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? ((b): c => d) : e", - "start":98,"end":122,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":46}} + "value": " Valid lhs value inside parentheses", + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":76,"end":97,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, "expression": { "type": "ConditionalExpression", "start":76,"end":96,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}}, @@ -126,30 +112,25 @@ "start":95,"end":96,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":20},"identifierName":"e"}, "name": "e" } - } - }, - { - "type": "ExpressionStatement", - "start":123,"end":146,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":23}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): c => d) : e", "start":98,"end":122,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":46}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? b : ((c): d => e)", - "start":147,"end":171,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":48}} - }, - { - "type": "CommentLine", - "value": " Nested arrow function inside parentheses", - "start":173,"end":216,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":43}} + "value": " a ? b : (c => d)", + "start":56,"end":75,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":37}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":123,"end":146,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":23}}, "expression": { "type": "ConditionalExpression", "start":123,"end":145,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":22}}, @@ -161,11 +142,11 @@ "consequent": { "type": "Identifier", "start":128,"end":129,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":6},"identifierName":"b"}, + "name": "b", "extra": { "parenthesized": true, "parenStart": 127 - }, - "name": "b" + } }, "alternate": { "type": "ArrowFunctionExpression", @@ -201,12 +182,8 @@ "name": "e" } } - } - }, - { - "type": "ExpressionStatement", - "start":217,"end":245,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":28}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? b : ((c): d => e)", @@ -218,13 +195,17 @@ "start":173,"end":216,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":43}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (b = (c) => d) : (e => f)", - "start":246,"end":278,"loc":{"start":{"line":7,"column":29},"end":{"line":7,"column":61}} + "value": " a ? ((b): c => d) : e", + "start":98,"end":122,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":46}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":217,"end":245,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":28}}, "expression": { "type": "ConditionalExpression", "start":217,"end":244,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":27}}, @@ -236,10 +217,6 @@ "consequent": { "type": "AssignmentExpression", "start":222,"end":234,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":17}}, - "extra": { - "parenthesized": true, - "parenStart": 221 - }, "operator": "=", "left": { "type": "Identifier", @@ -264,6 +241,10 @@ "start":233,"end":234,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":17},"identifierName":"d"}, "name": "d" } + }, + "extra": { + "parenthesized": true, + "parenStart": 221 } }, "alternate": { @@ -285,30 +266,30 @@ "name": "f" } } - } - }, - { - "type": "ExpressionStatement", - "start":279,"end":311,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":32}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (b = (c) => d) : (e => f)", "start":246,"end":278,"loc":{"start":{"line":7,"column":29},"end":{"line":7,"column":61}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? ((b = (c) => d): e => f) : g", - "start":312,"end":347,"loc":{"start":{"line":8,"column":33},"end":{"line":8,"column":68}} + "value": " a ? b : ((c): d => e)", + "start":147,"end":171,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":48}} }, { "type": "CommentLine", - "value": " Nested conditional expressions", - "start":349,"end":382,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":33}} + "value": " Nested arrow function inside parentheses", + "start":173,"end":216,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":43}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":279,"end":311,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":32}}, "expression": { "type": "ConditionalExpression", "start":279,"end":310,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":31}}, @@ -379,12 +360,8 @@ "start":309,"end":310,"loc":{"start":{"line":8,"column":30},"end":{"line":8,"column":31},"identifierName":"g"}, "name": "g" } - } - }, - { - "type": "ExpressionStatement", - "start":387,"end":418,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":35}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b = (c) => d): e => f) : g", @@ -396,13 +373,17 @@ "start":349,"end":382,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":33}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " b ? (c ? ((d): e => f) : g) : h", - "start":419,"end":453,"loc":{"start":{"line":11,"column":36},"end":{"line":11,"column":70}} + "value": " a ? (b = (c) => d) : (e => f)", + "start":246,"end":278,"loc":{"start":{"line":7,"column":29},"end":{"line":7,"column":61}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":387,"end":418,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":35}}, "expression": { "type": "ConditionalExpression", "start":387,"end":417,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":34}}, @@ -450,11 +431,11 @@ "body": { "type": "Identifier", "start":407,"end":408,"loc":{"start":{"line":11,"column":24},"end":{"line":11,"column":25},"identifierName":"f"}, + "name": "f", "extra": { "parenthesized": true, "parenStart": 406 - }, - "name": "f" + } } }, "alternate": { @@ -468,25 +449,30 @@ "start":416,"end":417,"loc":{"start":{"line":11,"column":33},"end":{"line":11,"column":34},"identifierName":"h"}, "name": "h" } - } - }, - { - "type": "ExpressionStatement", - "start":454,"end":489,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":35}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " b ? (c ? ((d): e => f) : g) : h", "start":419,"end":453,"loc":{"start":{"line":11,"column":36},"end":{"line":11,"column":70}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (b ? (c ? d : (e => f)) : g) : h", - "start":490,"end":529,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":75}} + "value": " a ? ((b = (c) => d): e => f) : g", + "start":312,"end":347,"loc":{"start":{"line":8,"column":33},"end":{"line":8,"column":68}} + }, + { + "type": "CommentLine", + "value": " Nested conditional expressions", + "start":349,"end":382,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":33}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":454,"end":489,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":35}}, "expression": { "type": "ConditionalExpression", "start":454,"end":488,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":34}}, @@ -514,11 +500,11 @@ "consequent": { "type": "Identifier", "start":467,"end":468,"loc":{"start":{"line":12,"column":13},"end":{"line":12,"column":14},"identifierName":"d"}, + "name": "d", "extra": { "parenthesized": true, "parenStart": 466 - }, - "name": "d" + } }, "alternate": { "type": "ArrowFunctionExpression", @@ -536,11 +522,11 @@ "body": { "type": "Identifier", "start":478,"end":479,"loc":{"start":{"line":12,"column":24},"end":{"line":12,"column":25},"identifierName":"f"}, + "name": "f", "extra": { "parenthesized": true, "parenStart": 477 - }, - "name": "f" + } } } }, @@ -555,30 +541,25 @@ "start":487,"end":488,"loc":{"start":{"line":12,"column":33},"end":{"line":12,"column":34},"identifierName":"h"}, "name": "h" } - } - }, - { - "type": "ExpressionStatement", - "start":531,"end":564,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":33}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (b ? (c ? d : (e => f)) : g) : h", "start":490,"end":529,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":75}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (b ? c : ((d): e => f)) : g", - "start":565,"end":599,"loc":{"start":{"line":14,"column":34},"end":{"line":14,"column":68}} - }, - { - "type": "CommentLine", - "value": " Multiple arrow functions", - "start":601,"end":628,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":27}} + "value": " b ? (c ? ((d): e => f) : g) : h", + "start":419,"end":453,"loc":{"start":{"line":11,"column":36},"end":{"line":11,"column":70}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":531,"end":564,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":33}}, "expression": { "type": "ConditionalExpression", "start":531,"end":563,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":32}}, @@ -598,11 +579,11 @@ "consequent": { "type": "Identifier", "start":540,"end":541,"loc":{"start":{"line":14,"column":9},"end":{"line":14,"column":10},"identifierName":"c"}, + "name": "c", "extra": { "parenthesized": true, "parenStart": 539 - }, - "name": "c" + } }, "alternate": { "type": "ArrowFunctionExpression", @@ -644,12 +625,8 @@ "start":562,"end":563,"loc":{"start":{"line":14,"column":31},"end":{"line":14,"column":32},"identifierName":"g"}, "name": "g" } - } - }, - { - "type": "ExpressionStatement", - "start":629,"end":661,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":32}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (b ? c : ((d): e => f)) : g", @@ -661,18 +638,17 @@ "start":601,"end":628,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":27}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? ((b): c => d) : ((e): f => g)", - "start":662,"end":698,"loc":{"start":{"line":17,"column":33},"end":{"line":17,"column":69}} - }, - { - "type": "CommentLine", - "value": " Multiple nested arrow functions ( is needed to avoid ambiguities)", - "start":700,"end":771,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":71}} + "value": " a ? (b ? (c ? d : (e => f)) : g) : h", + "start":490,"end":529,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":75}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":629,"end":661,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":32}}, "expression": { "type": "ConditionalExpression", "start":629,"end":660,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":31}}, @@ -749,12 +725,8 @@ "name": "g" } } - } - }, - { - "type": "ExpressionStatement", - "start":772,"end":804,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":32}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): c => d) : ((e): f => g)", @@ -766,13 +738,22 @@ "start":700,"end":771,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":71}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? ((b): c => ((d): e => f)) : g", - "start":805,"end":841,"loc":{"start":{"line":20,"column":33},"end":{"line":20,"column":69}} + "value": " a ? (b ? c : ((d): e => f)) : g", + "start":565,"end":599,"loc":{"start":{"line":14,"column":34},"end":{"line":14,"column":68}} + }, + { + "type": "CommentLine", + "value": " Multiple arrow functions", + "start":601,"end":628,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":27}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":772,"end":804,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":32}}, "expression": { "type": "ConditionalExpression", "start":772,"end":803,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":31}}, @@ -849,25 +830,30 @@ "start":802,"end":803,"loc":{"start":{"line":20,"column":30},"end":{"line":20,"column":31},"identifierName":"g"}, "name": "g" } - } - }, - { - "type": "ExpressionStatement", - "start":842,"end":873,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":31}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): c => ((d): e => f)) : g", "start":805,"end":841,"loc":{"start":{"line":20,"column":33},"end":{"line":20,"column":69}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? b : (c => ((d): e => f))", - "start":874,"end":908,"loc":{"start":{"line":21,"column":32},"end":{"line":21,"column":66}} + "value": " a ? ((b): c => d) : ((e): f => g)", + "start":662,"end":698,"loc":{"start":{"line":17,"column":33},"end":{"line":17,"column":69}} + }, + { + "type": "CommentLine", + "value": " Multiple nested arrow functions ( is needed to avoid ambiguities)", + "start":700,"end":771,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":71}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":842,"end":873,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":31}}, "expression": { "type": "ConditionalExpression", "start":842,"end":872,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":30}}, @@ -879,11 +865,11 @@ "consequent": { "type": "Identifier", "start":847,"end":848,"loc":{"start":{"line":21,"column":5},"end":{"line":21,"column":6},"identifierName":"b"}, + "name": "b", "extra": { "parenthesized": true, "parenStart": 846 - }, - "name": "b" + } }, "alternate": { "type": "ArrowFunctionExpression", @@ -945,30 +931,25 @@ } } } - } - }, - { - "type": "ExpressionStatement", - "start":909,"end":940,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":31}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? b : (c => ((d): e => f))", "start":874,"end":908,"loc":{"start":{"line":21,"column":32},"end":{"line":21,"column":66}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? ((b): c => d) : (e => f)", - "start":941,"end":975,"loc":{"start":{"line":22,"column":32},"end":{"line":22,"column":66}} - }, - { - "type": "CommentLine", - "value": " Invalid lhs value inside parentheses", - "start":977,"end":1016,"loc":{"start":{"line":24,"column":0},"end":{"line":24,"column":39}} + "value": " a ? ((b): c => ((d): e => f)) : g", + "start":805,"end":841,"loc":{"start":{"line":20,"column":33},"end":{"line":20,"column":69}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":909,"end":940,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":31}}, "expression": { "type": "ConditionalExpression", "start":909,"end":939,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":30}}, @@ -1008,11 +989,11 @@ "body": { "type": "Identifier", "start":928,"end":929,"loc":{"start":{"line":22,"column":19},"end":{"line":22,"column":20},"identifierName":"d"}, + "name": "d", "extra": { "parenthesized": true, "parenStart": 927 - }, - "name": "d" + } }, "typeParameters": { "type": "TypeParameterDeclaration", @@ -1046,12 +1027,8 @@ "name": "f" } } - } - }, - { - "type": "ExpressionStatement", - "start":1017,"end":1039,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":22}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): c => d) : (e => f)", @@ -1063,13 +1040,17 @@ "start":977,"end":1016,"loc":{"start":{"line":24,"column":0},"end":{"line":24,"column":39}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (b => c) : (d => e)", - "start":1040,"end":1066,"loc":{"start":{"line":25,"column":23},"end":{"line":25,"column":49}} + "value": " a ? b : (c => ((d): e => f))", + "start":874,"end":908,"loc":{"start":{"line":21,"column":32},"end":{"line":21,"column":66}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1017,"end":1039,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":22}}, "expression": { "type": "ConditionalExpression", "start":1017,"end":1038,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":21}}, @@ -1081,10 +1062,6 @@ "consequent": { "type": "ArrowFunctionExpression", "start":1022,"end":1028,"loc":{"start":{"line":25,"column":5},"end":{"line":25,"column":11}}, - "extra": { - "parenthesized": true, - "parenStart": 1021 - }, "id": null, "generator": false, "async": false, @@ -1099,6 +1076,10 @@ "type": "Identifier", "start":1027,"end":1028,"loc":{"start":{"line":25,"column":10},"end":{"line":25,"column":11},"identifierName":"c"}, "name": "c" + }, + "extra": { + "parenthesized": true, + "parenStart": 1021 } }, "alternate": { @@ -1120,30 +1101,30 @@ "name": "e" } } - } - }, - { - "type": "ExpressionStatement", - "start":1067,"end":1097,"loc":{"start":{"line":26,"column":0},"end":{"line":26,"column":30}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (b => c) : (d => e)", "start":1040,"end":1066,"loc":{"start":{"line":25,"column":23},"end":{"line":25,"column":49}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (b ? (c => d) : (e => f)) : g", - "start":1098,"end":1134,"loc":{"start":{"line":26,"column":31},"end":{"line":26,"column":67}} + "value": " a ? ((b): c => d) : (e => f)", + "start":941,"end":975,"loc":{"start":{"line":22,"column":32},"end":{"line":22,"column":66}} }, { "type": "CommentLine", - "value": " Invalid lhs value inside parentheses inside arrow function", - "start":1136,"end":1197,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":61}} + "value": " Invalid lhs value inside parentheses", + "start":977,"end":1016,"loc":{"start":{"line":24,"column":0},"end":{"line":24,"column":39}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1067,"end":1097,"loc":{"start":{"line":26,"column":0},"end":{"line":26,"column":30}}, "expression": { "type": "ConditionalExpression", "start":1067,"end":1096,"loc":{"start":{"line":26,"column":0},"end":{"line":26,"column":29}}, @@ -1163,10 +1144,6 @@ "consequent": { "type": "ArrowFunctionExpression", "start":1076,"end":1082,"loc":{"start":{"line":26,"column":9},"end":{"line":26,"column":15}}, - "extra": { - "parenthesized": true, - "parenStart": 1075 - }, "id": null, "generator": false, "async": false, @@ -1181,6 +1158,10 @@ "type": "Identifier", "start":1081,"end":1082,"loc":{"start":{"line":26,"column":14},"end":{"line":26,"column":15},"identifierName":"d"}, "name": "d" + }, + "extra": { + "parenthesized": true, + "parenStart": 1075 } }, "alternate": { @@ -1208,12 +1189,8 @@ "start":1095,"end":1096,"loc":{"start":{"line":26,"column":28},"end":{"line":26,"column":29},"identifierName":"g"}, "name": "g" } - } - }, - { - "type": "ExpressionStatement", - "start":1198,"end":1231,"loc":{"start":{"line":29,"column":0},"end":{"line":29,"column":33}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (b ? (c => d) : (e => f)) : g", @@ -1225,13 +1202,17 @@ "start":1136,"end":1197,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":61}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? ((b): c => (d => e)) : (f => g)", - "start":1232,"end":1270,"loc":{"start":{"line":29,"column":34},"end":{"line":29,"column":72}} + "value": " a ? (b => c) : (d => e)", + "start":1040,"end":1066,"loc":{"start":{"line":25,"column":23},"end":{"line":25,"column":49}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1198,"end":1231,"loc":{"start":{"line":29,"column":0},"end":{"line":29,"column":33}}, "expression": { "type": "ConditionalExpression", "start":1198,"end":1230,"loc":{"start":{"line":29,"column":0},"end":{"line":29,"column":32}}, @@ -1271,10 +1252,6 @@ "body": { "type": "ArrowFunctionExpression", "start":1214,"end":1220,"loc":{"start":{"line":29,"column":16},"end":{"line":29,"column":22}}, - "extra": { - "parenthesized": true, - "parenStart": 1213 - }, "id": null, "generator": false, "async": false, @@ -1289,6 +1266,10 @@ "type": "Identifier", "start":1219,"end":1220,"loc":{"start":{"line":29,"column":21},"end":{"line":29,"column":22},"identifierName":"e"}, "name": "e" + }, + "extra": { + "parenthesized": true, + "parenStart": 1213 } } }, @@ -1311,30 +1292,30 @@ "name": "g" } } - } - }, - { - "type": "ExpressionStatement", - "start":1271,"end":1313,"loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":42}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): c => (d => e)) : (f => g)", "start":1232,"end":1270,"loc":{"start":{"line":29,"column":34},"end":{"line":29,"column":72}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (b ? (c => d) : (e => (f => g))) : (h => i)", - "start":1314,"end":1364,"loc":{"start":{"line":30,"column":43},"end":{"line":30,"column":93}} + "value": " a ? (b ? (c => d) : (e => f)) : g", + "start":1098,"end":1134,"loc":{"start":{"line":26,"column":31},"end":{"line":26,"column":67}} }, { "type": "CommentLine", - "value": " Function as type annotation", - "start":1366,"end":1396,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":30}} + "value": " Invalid lhs value inside parentheses inside arrow function", + "start":1136,"end":1197,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":61}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1271,"end":1313,"loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":42}}, "expression": { "type": "ConditionalExpression", "start":1271,"end":1312,"loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":41}}, @@ -1354,10 +1335,6 @@ "consequent": { "type": "ArrowFunctionExpression", "start":1280,"end":1286,"loc":{"start":{"line":30,"column":9},"end":{"line":30,"column":15}}, - "extra": { - "parenthesized": true, - "parenStart": 1279 - }, "id": null, "generator": false, "async": false, @@ -1372,6 +1349,10 @@ "type": "Identifier", "start":1285,"end":1286,"loc":{"start":{"line":30,"column":14},"end":{"line":30,"column":15},"identifierName":"d"}, "name": "d" + }, + "extra": { + "parenthesized": true, + "parenStart": 1279 } }, "alternate": { @@ -1390,10 +1371,6 @@ "body": { "type": "ArrowFunctionExpression", "start":1296,"end":1302,"loc":{"start":{"line":30,"column":25},"end":{"line":30,"column":31}}, - "extra": { - "parenthesized": true, - "parenStart": 1295 - }, "id": null, "generator": false, "async": false, @@ -1408,6 +1385,10 @@ "type": "Identifier", "start":1301,"end":1302,"loc":{"start":{"line":30,"column":30},"end":{"line":30,"column":31},"identifierName":"g"}, "name": "g" + }, + "extra": { + "parenthesized": true, + "parenStart": 1295 } } } @@ -1431,12 +1412,8 @@ "name": "i" } } - } - }, - { - "type": "ExpressionStatement", - "start":1397,"end":1425,"loc":{"start":{"line":33,"column":0},"end":{"line":33,"column":28}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (b ? (c => d) : (e => (f => g))) : (h => i)", @@ -1448,18 +1425,17 @@ "start":1366,"end":1396,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":30}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? ((b): (c => d) => e) : f", - "start":1426,"end":1457,"loc":{"start":{"line":33,"column":29},"end":{"line":33,"column":60}} - }, - { - "type": "CommentLine", - "value": " Async functions or calls", - "start":1459,"end":1486,"loc":{"start":{"line":35,"column":0},"end":{"line":35,"column":27}} + "value": " a ? ((b): c => (d => e)) : (f => g)", + "start":1232,"end":1270,"loc":{"start":{"line":29,"column":34},"end":{"line":29,"column":72}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1397,"end":1425,"loc":{"start":{"line":33,"column":0},"end":{"line":33,"column":28}}, "expression": { "type": "ConditionalExpression", "start":1397,"end":1424,"loc":{"start":{"line":33,"column":0},"end":{"line":33,"column":27}}, @@ -1532,12 +1508,8 @@ "start":1423,"end":1424,"loc":{"start":{"line":33,"column":26},"end":{"line":33,"column":27},"identifierName":"f"}, "name": "f" } - } - }, - { - "type": "ExpressionStatement", - "start":1487,"end":1510,"loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":23}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): (c => d) => e) : f", @@ -1549,13 +1521,22 @@ "start":1459,"end":1486,"loc":{"start":{"line":35,"column":0},"end":{"line":35,"column":27}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (async(b)) : (c => d)", - "start":1511,"end":1539,"loc":{"start":{"line":36,"column":24},"end":{"line":36,"column":52}} + "value": " a ? (b ? (c => d) : (e => (f => g))) : (h => i)", + "start":1314,"end":1364,"loc":{"start":{"line":30,"column":43},"end":{"line":30,"column":93}} + }, + { + "type": "CommentLine", + "value": " Function as type annotation", + "start":1366,"end":1396,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":30}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1487,"end":1510,"loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":23}}, "expression": { "type": "ConditionalExpression", "start":1487,"end":1509,"loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":22}}, @@ -1599,25 +1580,30 @@ "name": "d" } } - } - }, - { - "type": "ExpressionStatement", - "start":1540,"end":1567,"loc":{"start":{"line":37,"column":0},"end":{"line":37,"column":27}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (async(b)) : (c => d)", "start":1511,"end":1539,"loc":{"start":{"line":36,"column":24},"end":{"line":36,"column":52}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (async (b): c => d) : e", - "start":1568,"end":1598,"loc":{"start":{"line":37,"column":28},"end":{"line":37,"column":58}} + "value": " a ? ((b): (c => d) => e) : f", + "start":1426,"end":1457,"loc":{"start":{"line":33,"column":29},"end":{"line":33,"column":60}} + }, + { + "type": "CommentLine", + "value": " Async functions or calls", + "start":1459,"end":1486,"loc":{"start":{"line":35,"column":0},"end":{"line":35,"column":27}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1540,"end":1567,"loc":{"start":{"line":37,"column":0},"end":{"line":37,"column":27}}, "expression": { "type": "ConditionalExpression", "start":1540,"end":1566,"loc":{"start":{"line":37,"column":0},"end":{"line":37,"column":26}}, @@ -1664,25 +1650,25 @@ "start":1565,"end":1566,"loc":{"start":{"line":37,"column":25},"end":{"line":37,"column":26},"identifierName":"e"}, "name": "e" } - } - }, - { - "type": "ExpressionStatement", - "start":1599,"end":1627,"loc":{"start":{"line":38,"column":0},"end":{"line":38,"column":28}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (async (b): c => d) : e", "start":1568,"end":1598,"loc":{"start":{"line":37,"column":28},"end":{"line":37,"column":58}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (async(b => c)) : (d => e)", - "start":1628,"end":1661,"loc":{"start":{"line":38,"column":29},"end":{"line":38,"column":62}} + "value": " a ? (async(b)) : (c => d)", + "start":1511,"end":1539,"loc":{"start":{"line":36,"column":24},"end":{"line":36,"column":52}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1599,"end":1627,"loc":{"start":{"line":38,"column":0},"end":{"line":38,"column":28}}, "expression": { "type": "ConditionalExpression", "start":1599,"end":1626,"loc":{"start":{"line":38,"column":0},"end":{"line":38,"column":27}}, @@ -1740,30 +1726,25 @@ "name": "e" } } - } - }, - { - "type": "ExpressionStatement", - "start":1662,"end":1697,"loc":{"start":{"line":39,"column":0},"end":{"line":39,"column":35}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (async(b => c)) : (d => e)", "start":1628,"end":1661,"loc":{"start":{"line":38,"column":29},"end":{"line":38,"column":62}} } ], - "trailingComments": [ + "leadingComments": [ { "type": "CommentLine", - "value": " a ? (async (b) => c => d) : (e => f)", - "start":1698,"end":1737,"loc":{"start":{"line":39,"column":36},"end":{"line":39,"column":75}} - }, - { - "type": "CommentLine", - "value": " https://github.com/prettier/prettier/issues/2194", - "start":1739,"end":1790,"loc":{"start":{"line":41,"column":0},"end":{"line":41,"column":51}} + "value": " a ? (async (b): c => d) : e", + "start":1568,"end":1598,"loc":{"start":{"line":37,"column":28},"end":{"line":37,"column":58}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":1662,"end":1697,"loc":{"start":{"line":39,"column":0},"end":{"line":39,"column":35}}, "expression": { "type": "ConditionalExpression", "start":1662,"end":1696,"loc":{"start":{"line":39,"column":0},"end":{"line":39,"column":34}}, @@ -1788,10 +1769,6 @@ "body": { "type": "ArrowFunctionExpression", "start":1680,"end":1686,"loc":{"start":{"line":39,"column":18},"end":{"line":39,"column":24}}, - "extra": { - "parenthesized": true, - "parenStart": 1679 - }, "id": null, "generator": false, "async": false, @@ -1806,6 +1783,10 @@ "type": "Identifier", "start":1685,"end":1686,"loc":{"start":{"line":39,"column":23},"end":{"line":39,"column":24},"identifierName":"d"}, "name": "d" + }, + "extra": { + "parenthesized": true, + "parenStart": 1679 } } }, @@ -1828,12 +1809,8 @@ "name": "f" } } - } - }, - { - "type": "VariableDeclaration", - "start":1791,"end":1930,"loc":{"start":{"line":42,"column":0},"end":{"line":44,"column":36}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " a ? (async (b) => c => d) : (e => f)", @@ -1845,6 +1822,17 @@ "start":1739,"end":1790,"loc":{"start":{"line":41,"column":0},"end":{"line":41,"column":51}} } ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " a ? (async(b => c)) : (d => e)", + "start":1628,"end":1661,"loc":{"start":{"line":38,"column":29},"end":{"line":38,"column":62}} + } + ] + }, + { + "type": "VariableDeclaration", + "start":1791,"end":1930,"loc":{"start":{"line":42,"column":0},"end":{"line":44,"column":36}}, "declarations": [ { "type": "VariableDeclarator", @@ -1892,10 +1880,6 @@ "body": { "type": "ConditionalExpression", "start":1831,"end":1892,"loc":{"start":{"line":43,"column":10},"end":{"line":43,"column":71}}, - "extra": { - "parenthesized": true, - "parenStart": 1830 - }, "test": { "type": "UnaryExpression", "start":1831,"end":1834,"loc":{"start":{"line":43,"column":10},"end":{"line":43,"column":13}}, @@ -1959,6 +1943,10 @@ "tail": true } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 1830 } } }, @@ -2024,7 +2012,19 @@ } } ], - "kind": "let" + "kind": "let", + "leadingComments": [ + { + "type": "CommentLine", + "value": " a ? (async (b) => c => d) : (e => f)", + "start":1698,"end":1737,"loc":{"start":{"line":39,"column":36},"end":{"line":39,"column":75}} + }, + { + "type": "CommentLine", + "value": " https://github.com/prettier/prettier/issues/2194", + "start":1739,"end":1790,"loc":{"start":{"line":41,"column":0},"end":{"line":41,"column":51}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/comment-disabled/05-type-annotation/output.json b/packages/babel-parser/test/fixtures/flow/comment-disabled/05-type-annotation/output.json index 9c7b8a8467..9272cb2156 100644 --- a/packages/babel-parser/test/fixtures/flow/comment-disabled/05-type-annotation/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment-disabled/05-type-annotation/output.json @@ -34,15 +34,15 @@ "body": { "type": "BlockStatement", "start":51,"end":54,"loc":{"start":{"line":1,"column":51},"end":{"line":2,"column":1}}, + "body": [], + "directives": [], "leadingComments": [ { "type": "CommentBlock", "value": ": number ", "start":37,"end":50,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":50}} } - ], - "body": [], - "directives": [] + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json index bfcedf2ad9..c394c1e37a 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json @@ -7,17 +7,17 @@ "program": { "type": "Program", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, + "sourceType": "module", + "interpreter": null, + "body": [], + "directives": [], "innerComments": [ { "type": "CommentLine", "value": "asd */", "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}} } - ], - "sourceType": "module", - "interpreter": null, - "body": [], - "directives": [] + ] }, "comments": [ { diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/output.json index c34b19b78a..9dcd730880 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-explicit/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":46,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, "members": [ { @@ -48,8 +49,7 @@ "value": false } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/output.json index c17beff73c..552b5cd9fa 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-implicit/output.json @@ -18,8 +18,8 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":35,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, - "explicitType": false, "hasUnknownMembers": false, + "explicitType": false, "members": [ { "type": "EnumBooleanMember", diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json index c8d39bd083..016ac1c96e 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":26,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json index a50af0f91c..3c3ed4597b 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json @@ -21,8 +21,8 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, - "explicitType": false, "hasUnknownMembers": false, + "explicitType": false, "members": [ { "type": "EnumBooleanMember", diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json index 0a31c3040a..89ca1b9f3d 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json @@ -21,6 +21,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, "members": [ { @@ -41,8 +42,7 @@ "name": "A" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json index 8251d5bbd5..efe5bee456 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json @@ -18,9 +18,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/output.json index ae5d559199..c7b92e3b2f 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/enum-name/output.json @@ -18,9 +18,9 @@ "body": { "type": "EnumStringBody", "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":2,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json index 30a5ede01a..48b2f6e737 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json @@ -24,9 +24,9 @@ "body": { "type": "EnumStringBody", "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } }, @@ -44,9 +44,9 @@ "body": { "type": "EnumStringBody", "start":40,"end":42,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":24}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json index d39e36c96d..e971927a59 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json index 17e38f263e..1eb77ab89d 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json index 02a9f0f0b0..170b868006 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":2,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json index 9e16c209eb..4f5de60eb5 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json index 169c12667f..b32b0b2776 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json @@ -21,8 +21,8 @@ "body": { "type": "EnumSymbolBody", "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, - "members": [], - "hasUnknownMembers": false + "hasUnknownMembers": false, + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json index 14bbdfbda9..993c1827c2 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json index c496f854cb..aa4ce7973f 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumStringBody", "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json index 3a7df84a7a..6765f236dc 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumBooleanBody", "start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json index 8a9c7b3bd3..17fa93feed 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumNumberBody", "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json index dc53fd5d5a..fc64cd97f2 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json @@ -22,6 +22,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, "members": [ { @@ -42,8 +43,7 @@ "name": "bar" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/output.json index 5f6412acfd..3c344c7702 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/no-trailing-comma/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, "members": [ { @@ -29,8 +30,7 @@ "name": "A" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/output.json index eb54b373d2..9dbb863ec2 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-explicit/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumNumberBody", "start":7,"end":38,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, "members": [ { @@ -56,8 +57,7 @@ "value": 2 } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/output.json index bb4166ab48..0ac2f840a3 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-implicit/output.json @@ -18,8 +18,8 @@ "body": { "type": "EnumNumberBody", "start":7,"end":28,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, - "explicitType": false, "hasUnknownMembers": false, + "explicitType": false, "members": [ { "type": "EnumNumberMember", diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json index fb8576d1af..b433fdbe89 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json @@ -21,9 +21,9 @@ "body": { "type": "EnumNumberBody", "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json index 61135052b6..8a2459830b 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json @@ -21,8 +21,8 @@ "body": { "type": "EnumNumberBody", "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, - "explicitType": false, "hasUnknownMembers": false, + "explicitType": false, "members": [ { "type": "EnumNumberMember", diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/output.json index 9946ca0ad2..69906d69e9 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-defaulted/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, "members": [ { @@ -38,8 +39,7 @@ "name": "B" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/output.json index e9c04de11f..65ae9963f8 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-explicit-initialized/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":42,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, "members": [ { @@ -56,8 +57,7 @@ "value": "b" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/output.json index e3a939805c..5880461841 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-defaulted/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, "members": [ { @@ -38,8 +39,7 @@ "name": "B" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/output.json index b7c04a9e01..f112719ac3 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-implicit-initialized/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, "members": [ { @@ -56,8 +57,7 @@ "value": "b" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json index 7f5906cc2f..63b407e57d 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json @@ -21,6 +21,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":41,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, "members": [ { @@ -41,8 +42,7 @@ "name": "C" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json index d57bcebfb9..f86dbec34e 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json @@ -21,6 +21,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":47,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, + "hasUnknownMembers": false, "explicitType": true, "members": [ { @@ -59,8 +60,7 @@ "value": "c" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json index 91a4161a67..07020d775b 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumSymbolBody", "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "hasUnknownMembers": false, "members": [ { "type": "EnumDefaultedMember", @@ -37,8 +38,7 @@ "name": "B" } } - ], - "hasUnknownMembers": false + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/unknown-members/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/unknown-members/output.json index b681e62d10..acf4be85bc 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/unknown-members/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/unknown-members/output.json @@ -18,6 +18,7 @@ "body": { "type": "EnumStringBody", "start":7,"end":26,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, + "hasUnknownMembers": true, "explicitType": false, "members": [ { @@ -38,8 +39,7 @@ "name": "B" } } - ], - "hasUnknownMembers": true + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json index 35964d8e51..760ce91ec1 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json @@ -13,13 +13,6 @@ { "type": "DeclareClass", "start":8,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":4,"column":1}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, @@ -37,7 +30,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json index 1d1b441e43..54e541fb1b 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json @@ -13,13 +13,6 @@ { "type": "DeclareClass", "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"B"}, @@ -57,7 +50,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json index def4a6ab48..8e79cda250 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json @@ -14,13 +14,6 @@ { "type": "DeclareClass", "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"C"}, @@ -58,7 +51,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json index baf91fda2f..ea5396b402 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json @@ -14,13 +14,6 @@ { "type": "DeclareClass", "start":8,"end":64,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"D"}, @@ -77,7 +70,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json index 52ca6a7b16..642342b82b 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json @@ -13,13 +13,6 @@ { "type": "InterfaceDeclaration", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"F"}, @@ -57,7 +50,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json index c05fb49b07..667d856f50 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json @@ -14,13 +14,6 @@ { "type": "InterfaceDeclaration", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"G"}, @@ -58,7 +51,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json index e387f51c3e..24ca1d4bfe 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json @@ -14,13 +14,6 @@ { "type": "InterfaceDeclaration", "start":8,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"H"}, @@ -77,7 +70,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json index 78a7c5b512..cc88ac8231 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json @@ -13,13 +13,6 @@ { "type": "TypeAlias", "start":8,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -55,7 +48,14 @@ "internalSlots": [], "exact": true, "inexact": true - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json index 0d9f4b00f0..da8b07d303 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json @@ -13,13 +13,6 @@ { "type": "TypeAlias", "start":8,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -55,7 +48,14 @@ "internalSlots": [], "exact": false, "inexact": true - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json index 2bf826537e..28d9de1574 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json @@ -13,13 +13,6 @@ { "type": "TypeAlias", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":37}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -74,7 +67,14 @@ "internalSlots": [], "exact": false, "inexact": true - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json index 15cdfdd179..01e75afac8 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json @@ -13,13 +13,6 @@ { "type": "TypeAlias", "start":8,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"U"}, @@ -55,7 +48,14 @@ "internalSlots": [], "exact": false, "inexact": true - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json index f72a571b86..7b0a80a8f4 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json @@ -13,13 +13,6 @@ { "type": "TypeAlias", "start":8,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"V"}, @@ -69,7 +62,14 @@ "internalSlots": [], "exact": false, "inexact": true - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json index 870295c807..9a0f583d0c 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json @@ -13,13 +13,6 @@ { "type": "InterfaceDeclaration", "start":9,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -58,7 +51,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json index 5ae6cee7b6..49aaa76cd3 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json @@ -13,13 +13,6 @@ { "type": "InterfaceDeclaration", "start":9,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -67,7 +60,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json index e7845d7709..22d7d8a6a3 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json @@ -13,13 +13,6 @@ { "type": "InterfaceDeclaration", "start":9,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -48,7 +41,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json index 3db5700fa5..e7f87ebf42 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json @@ -13,13 +13,6 @@ { "type": "InterfaceDeclaration", "start":9,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -57,7 +50,14 @@ "indexers": [], "internalSlots": [], "exact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/property/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/property/output.json index 671cbb4a67..c118afb24b 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/property/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/property/output.json @@ -13,10 +13,6 @@ "expression": { "type": "ObjectExpression", "start":1,"end":23,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":1}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "properties": [ { "type": "ObjectProperty", @@ -39,7 +35,11 @@ "value": "foo" } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json index 42005e7bcc..a0670155d9 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json @@ -16,10 +16,6 @@ "expression": { "type": "SequenceExpression", "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "expressions": [ { "type": "Identifier", @@ -35,7 +31,11 @@ }, "value": "foo" } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/flow/iterator/12/output.json b/packages/babel-parser/test/fixtures/flow/iterator/12/output.json index 75fcbeb9c0..13699986d6 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/12/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/12/output.json @@ -71,10 +71,6 @@ "argument": { "type": "TypeCastExpression", "start":57,"end":63,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, - "extra": { - "parenthesized": true, - "parenStart": 56 - }, "expression": { "type": "NumericLiteral", "start":57,"end":58,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, @@ -91,6 +87,10 @@ "type": "AnyTypeAnnotation", "start":60,"end":63,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}} } + }, + "extra": { + "parenthesized": true, + "parenStart": 56 } } } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/13/output.json b/packages/babel-parser/test/fixtures/flow/iterator/13/output.json index a7d70847b5..e2ea3c650a 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/13/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/13/output.json @@ -71,10 +71,6 @@ "argument": { "type": "TypeCastExpression", "start":62,"end":68,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, - "extra": { - "parenthesized": true, - "parenStart": 61 - }, "expression": { "type": "NumericLiteral", "start":62,"end":63,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, @@ -91,6 +87,10 @@ "type": "AnyTypeAnnotation", "start":65,"end":68,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}} } + }, + "extra": { + "parenthesized": true, + "parenStart": 61 } } } diff --git a/packages/babel-parser/test/fixtures/flow/pragma/2/output.json b/packages/babel-parser/test/fixtures/flow/pragma/2/output.json index 657920883e..532775b9c6 100644 --- a/packages/babel-parser/test/fixtures/flow/pragma/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/pragma/2/output.json @@ -58,11 +58,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" }, "trailingComments": [ { diff --git a/packages/babel-parser/test/fixtures/flow/pragma/4/output.json b/packages/babel-parser/test/fixtures/flow/pragma/4/output.json index e391f94cd9..16f343d83c 100644 --- a/packages/babel-parser/test/fixtures/flow/pragma/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/pragma/4/output.json @@ -63,11 +63,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" }, "trailingComments": [ { diff --git a/packages/babel-parser/test/fixtures/flow/pragma/5/output.json b/packages/babel-parser/test/fixtures/flow/pragma/5/output.json index 9bbad04360..e5eef20b2d 100644 --- a/packages/babel-parser/test/fixtures/flow/pragma/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/pragma/5/output.json @@ -67,11 +67,11 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, - "value": "use strict", "extra": { - "raw": "'use strict'", - "rawValue": "use strict" - } + "rawValue": "use strict", + "raw": "'use strict'" + }, + "value": "use strict" }, "trailingComments": [ { diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-10314/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-10314/output.json index 8bb74d389a..75ae036db5 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-10314/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-10314/output.json @@ -29,12 +29,12 @@ "start":17,"end":22,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":12},"identifierName":"async"}, "name": "async" }, + "computed": false, "property": { "type": "Identifier", "start":23,"end":32,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":22},"identifierName":"waterfall"}, "name": "waterfall" - }, - "computed": false + } }, "arguments": [] }, diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-2083/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-2083/output.json index 42b9161b37..f6ac46b517 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-2083/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-2083/output.json @@ -67,12 +67,12 @@ "start":51,"end":61,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":22},"identifierName":"MatrixType"}, "name": "MatrixType" }, + "computed": false, "property": { "type": "Identifier", "start":62,"end":71,"loc":{"start":{"line":4,"column":23},"end":{"line":4,"column":32},"identifierName":"IsScaling"}, "name": "IsScaling" - }, - "computed": false + } }, "operator": "|", "right": { @@ -83,12 +83,12 @@ "start":74,"end":84,"loc":{"start":{"line":4,"column":35},"end":{"line":4,"column":45},"identifierName":"MatrixType"}, "name": "MatrixType" }, + "computed": false, "property": { "type": "Identifier", "start":85,"end":98,"loc":{"start":{"line":4,"column":46},"end":{"line":4,"column":59},"identifierName":"IsTranslation"}, "name": "IsTranslation" - }, - "computed": false + } }, "extra": { "parenthesized": true, diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-2493/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-2493/output.json index 4f09012ac7..cc15c80835 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-2493/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-2493/output.json @@ -80,12 +80,12 @@ "start":57,"end":64,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9},"identifierName":"console"}, "name": "console" }, + "computed": false, "property": { "type": "Identifier", "start":65,"end":68,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"log"}, "name": "log" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/object-constructor/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/object-constructor/output.json index 7736cab5a7..7b2efbe938 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/object-constructor/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/object-constructor/output.json @@ -10,20 +10,9 @@ { "type": "ExpressionStatement", "start":10,"end":47,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":2}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "expression": { "type": "ObjectExpression", "start":11,"end":46,"loc":{"start":{"line":3,"column":1},"end":{"line":5,"column":1}}, - "extra": { - "parenthesized": true, - "parenStart": 10 - }, "properties": [ { "type": "ObjectMethod", @@ -61,8 +50,19 @@ "directives": [] } } - ] - } + ], + "extra": { + "parenthesized": true, + "parenStart": 10 + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/object-type-constructor/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/object-type-constructor/output.json index 8555aed34e..ac4fdeddcf 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/object-type-constructor/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/object-type-constructor/output.json @@ -10,13 +10,6 @@ { "type": "TypeAlias", "start":10,"end":60,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":1}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "id": { "type": "Identifier", "start":15,"end":16,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"T"}, @@ -68,7 +61,14 @@ "internalSlots": [], "exact": false, "inexact": false - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/negative-number-literal/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/negative-number-literal/output.json index 37c944d36f..66da1df9c9 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/negative-number-literal/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/negative-number-literal/output.json @@ -116,12 +116,12 @@ "start":91,"end":98,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":7},"identifierName":"console"}, "name": "console" }, + "computed": false, "property": { "type": "Identifier", "start":99,"end":102,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":11},"identifierName":"log"}, "name": "log" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json index a0b64c179d..d008493636 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json @@ -13,13 +13,6 @@ { "type": "VariableDeclaration", "start":9,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "declarations": [ { "type": "VariableDeclarator", @@ -67,7 +60,14 @@ } } ], - "kind": "const" + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json index 28c79510d2..c9249105c8 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json @@ -13,13 +13,6 @@ { "type": "VariableDeclaration", "start":9,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "declarations": [ { "type": "VariableDeclarator", @@ -67,7 +60,14 @@ } } ], - "kind": "const" + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json index 4ae2409d44..967c2166ab 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json @@ -13,13 +13,6 @@ { "type": "VariableDeclaration", "start":9,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "declarations": [ { "type": "VariableDeclarator", @@ -58,7 +51,14 @@ } } ], - "kind": "const" + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json index 4b10af5f15..05f0fb1c79 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json @@ -13,13 +13,6 @@ { "type": "VariableDeclaration", "start":9,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":40}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ], "declarations": [ { "type": "VariableDeclarator", @@ -67,7 +60,14 @@ } } ], - "kind": "const" + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-2/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-2/output.json index 93177aa125..626dfaa766 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-2/output.json @@ -131,4 +131,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-like/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-like/output.json index a722a57375..3558cb8576 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-like/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-like/output.json @@ -10,18 +10,6 @@ { "type": "ExpressionStatement", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " This looks A LOT like an async arrow function, but it isn't because", - "start":25,"end":95,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":70}} - }, - { - "type": "CommentLine", - "value": " T + U isn't a valid type parameter.", - "start":96,"end":134,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}} - } - ], "expression": { "type": "BinaryExpression", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, @@ -44,10 +32,6 @@ "right": { "type": "TypeCastExpression", "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - }, "expression": { "type": "Identifier", "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, @@ -74,14 +58,14 @@ }, "typeParameters": null } + }, + "extra": { + "parenthesized": true, + "parenStart": 9 } } - } - }, - { - "type": "ExpressionStatement", - "start":135,"end":167,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":32}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " This looks A LOT like an async arrow function, but it isn't because", @@ -92,14 +76,14 @@ "value": " T + U isn't a valid type parameter.", "start":96,"end":134,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}} } - ], + ] + }, + { + "type": "ExpressionStatement", + "start":135,"end":167,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":32}}, "expression": { "type": "TypeCastExpression", "start":136,"end":165,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":30}}, - "extra": { - "parenthesized": true, - "parenStart": 135 - }, "expression": { "type": "BinaryExpression", "start":136,"end":156,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":21}}, @@ -132,10 +116,6 @@ "right": { "type": "TypeCastExpression", "start":150,"end":155,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":20}}, - "extra": { - "parenthesized": true, - "parenStart": 149 - }, "expression": { "type": "Identifier", "start":150,"end":152,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":17},"identifierName":"fn"}, @@ -154,6 +134,10 @@ "name": "T" } } + }, + "extra": { + "parenthesized": true, + "parenStart": 149 } } }, @@ -195,8 +179,24 @@ }, "typeParameters": null } + }, + "extra": { + "parenthesized": true, + "parenStart": 135 } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " This looks A LOT like an async arrow function, but it isn't because", + "start":25,"end":95,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":70}} + }, + { + "type": "CommentLine", + "value": " T + U isn't a valid type parameter.", + "start":96,"end":134,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/output.json index 615b9d5216..d9223b3352 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default/output.json @@ -420,10 +420,6 @@ "expression": { "type": "ClassExpression", "start":297,"end":321,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 296 - }, "id": { "type": "Identifier", "start":303,"end":306,"loc":{"start":{"line":10,"column":8},"end":{"line":10,"column":11},"identifierName":"A10"}, @@ -450,6 +446,10 @@ "type": "ClassBody", "start":319,"end":321,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":26}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 296 } } }, @@ -459,10 +459,6 @@ "expression": { "type": "ClassExpression", "start":325,"end":358,"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":35}}, - "extra": { - "parenthesized": true, - "parenStart": 324 - }, "id": { "type": "Identifier", "start":331,"end":334,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":11},"identifierName":"A11"}, @@ -501,6 +497,10 @@ "type": "ClassBody", "start":356,"end":358,"loc":{"start":{"line":11,"column":33},"end":{"line":11,"column":35}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 324 } } }, @@ -510,10 +510,6 @@ "expression": { "type": "ClassExpression", "start":362,"end":398,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":38}}, - "extra": { - "parenthesized": true, - "parenStart": 361 - }, "id": { "type": "Identifier", "start":368,"end":371,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":11},"identifierName":"A12"}, @@ -558,6 +554,10 @@ "type": "ClassBody", "start":396,"end":398,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":38}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 361 } } }, @@ -567,10 +567,6 @@ "expression": { "type": "ClassExpression", "start":402,"end":447,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":47}}, - "extra": { - "parenthesized": true, - "parenStart": 401 - }, "id": { "type": "Identifier", "start":408,"end":411,"loc":{"start":{"line":13,"column":8},"end":{"line":13,"column":11},"identifierName":"A13"}, @@ -619,6 +615,10 @@ "type": "ClassBody", "start":445,"end":447,"loc":{"start":{"line":13,"column":45},"end":{"line":13,"column":47}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 401 } } }, @@ -1101,10 +1101,6 @@ "expression": { "type": "ObjectExpression", "start":836,"end":860,"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 835 - }, "properties": [ { "type": "ObjectMethod", @@ -1144,7 +1140,11 @@ ] } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 835 + } } }, { @@ -1211,10 +1211,6 @@ "expression": { "type": "ClassExpression", "start":902,"end":938,"loc":{"start":{"line":28,"column":2},"end":{"line":30,"column":1}}, - "extra": { - "parenthesized": true, - "parenStart": 901 - }, "id": { "type": "Identifier", "start":908,"end":911,"loc":{"start":{"line":28,"column":8},"end":{"line":28,"column":11},"identifierName":"A30"}, @@ -1264,6 +1260,10 @@ } } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 901 } } }, diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-computed/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-computed/output.json index acef855dde..4d5a2ff0ae 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-computed/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-computed/output.json @@ -21,12 +21,12 @@ "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"o"}, "name": "o" }, + "computed": true, "property": { "type": "Identifier", "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"e"}, "name": "e" - }, - "computed": true + } }, "typeArguments": { "type": "TypeParameterInstantiation", diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional/output.json index 9a2538975c..bf792d4a3b 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional/output.json @@ -21,12 +21,12 @@ "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":12,"end":13,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"m"}, "name": "m" }, - "computed": false, "optional": true }, "typeArguments": { diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional2/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional2/output.json index 152e3df13b..5fad3a7bfb 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional2/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional2/output.json @@ -21,12 +21,12 @@ "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"m"}, "name": "m" - }, - "computed": false + } }, "typeArguments": { "type": "TypeParameterInstantiation", diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call/output.json index b4ee22f6fc..18591360a9 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call/output.json @@ -21,12 +21,12 @@ "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"o"}, "name": "o" }, + "computed": false, "property": { "type": "Identifier", "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"m"}, "name": "m" - }, - "computed": false + } }, "typeArguments": { "type": "TypeParameterInstantiation", diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json index ef23432c66..490f83245b 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json @@ -13,13 +13,6 @@ { "type": "VariableDeclaration", "start":8,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "declarations": [ { "type": "VariableDeclarator", @@ -69,7 +62,14 @@ } } ], - "kind": "var" + "kind": "var", + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json index 2f5e884ae1..293cf86e6a 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json @@ -13,13 +13,6 @@ { "type": "TypeAlias", "start":8,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"_"}, @@ -29,7 +22,14 @@ "right": { "type": "NumberTypeAnnotation", "start":17,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json index c12e93560d..8f043eeb34 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json @@ -14,13 +14,6 @@ { "type": "TypeAlias", "start":8,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ], "id": { "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":12},"identifierName":"Generic"}, @@ -47,7 +40,14 @@ "start":26,"end":27,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"_"}, "name": "_" } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_methods/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_methods/output.json index 5903b12085..a87562cc10 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_methods/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_methods/output.json @@ -24,12 +24,12 @@ "start":8,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8},"identifierName":"instance"}, "name": "instance" }, + "computed": false, "property": { "type": "Identifier", "start":17,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15},"identifierName":"method"}, "name": "method" - }, - "computed": false + } }, "arguments": [] }, diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/3/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/3/output.json index abd3347382..1079b26a2c 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/3/output.json @@ -13,10 +13,6 @@ "expression": { "type": "TypeCastExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "expression": { "type": "ArrowFunctionExpression", "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, @@ -80,6 +76,10 @@ }, "typeParameters": null } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json index b4b1f013c4..61b78348b5 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json @@ -16,10 +16,6 @@ "expression": { "type": "SequenceExpression", "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "expressions": [ { "type": "Identifier", @@ -49,7 +45,11 @@ } } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json index 101e6aae6b..08f11516bd 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ArrayExpression", "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "elements": [ { "type": "TypeCastExpression", @@ -38,7 +34,11 @@ } } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json index 35a0d73ad0..dc3bcc6b34 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json @@ -16,10 +16,6 @@ "expression": { "type": "ArrayExpression", "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "elements": [ { "type": "Identifier", @@ -49,7 +45,11 @@ } ] } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } } } ], diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func/output.json index ccd99ab2c0..5879f5141e 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func/output.json @@ -106,4 +106,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/basic/20/output.json b/packages/babel-parser/test/fixtures/jsx/basic/20/output.json index c1de95224e..e68b2ebcb5 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/20/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/20/output.json @@ -44,19 +44,19 @@ "start":7,"end":9,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":9},"identifierName":"aa"}, "name": "aa" }, + "computed": false, "property": { "type": "Identifier", "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"bb"}, "name": "bb" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15},"identifierName":"cc"}, "name": "cc" - }, - "computed": false + } } } }, @@ -82,19 +82,19 @@ "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23},"identifierName":"bb"}, "name": "bb" }, + "computed": false, "property": { "type": "Identifier", "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26},"identifierName":"cc"}, "name": "cc" - }, - "computed": false + } }, + "computed": false, "property": { "type": "Identifier", "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29},"identifierName":"dd"}, "name": "dd" - }, - "computed": false + } } } } @@ -146,12 +146,12 @@ "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39},"identifierName":"aa"}, "name": "aa" }, + "computed": false, "property": { "type": "Identifier", "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"b"}, "name": "b" - }, - "computed": false + } } } ] diff --git a/packages/babel-parser/test/fixtures/jsx/basic/sequence-expression/output.json b/packages/babel-parser/test/fixtures/jsx/basic/sequence-expression/output.json index 1afdb0d06d..8c8f83405c 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/sequence-expression/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/sequence-expression/output.json @@ -40,10 +40,6 @@ "expression": { "type": "SequenceExpression", "start":7,"end":48,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":48}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "expressions": [ { "type": "CallExpression", @@ -101,7 +97,11 @@ } ] } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } } } ] diff --git a/packages/babel-parser/test/fixtures/jsx/errors/sequence-expression-parenthesized/output.json b/packages/babel-parser/test/fixtures/jsx/errors/sequence-expression-parenthesized/output.json index 1afdb0d06d..8c8f83405c 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/sequence-expression-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/sequence-expression-parenthesized/output.json @@ -40,10 +40,6 @@ "expression": { "type": "SequenceExpression", "start":7,"end":48,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":48}}, - "extra": { - "parenthesized": true, - "parenStart": 6 - }, "expressions": [ { "type": "CallExpression", @@ -101,7 +97,11 @@ } ] } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } } } ] diff --git a/packages/babel-parser/test/fixtures/jsx/regression/issue-11387/output.json b/packages/babel-parser/test/fixtures/jsx/regression/issue-11387/output.json index 6627c48a90..92a2494c24 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/issue-11387/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/issue-11387/output.json @@ -48,12 +48,12 @@ "type": "ThisExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}} }, + "computed": false, "property": { "type": "Identifier", "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18},"identifierName":"class"}, "name": "class" }, - "computed": false, "optional": true }, { @@ -63,12 +63,12 @@ "type": "ThisExpression", "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24}} }, + "computed": false, "property": { "type": "Identifier", "start":25,"end":30,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":30},"identifierName":"class"}, "name": "class" - }, - "computed": false + } }, { "type": "OptionalMemberExpression", @@ -77,12 +77,12 @@ "type": "ThisExpression", "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36}} }, + "computed": false, "property": { "type": "Identifier", "start":38,"end":46,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":46},"identifierName":"function"}, "name": "function" }, - "computed": false, "optional": true }, { @@ -92,12 +92,12 @@ "type": "ThisExpression", "start":48,"end":52,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":52}} }, + "computed": false, "property": { "type": "Identifier", "start":53,"end":61,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":61},"identifierName":"function"}, "name": "function" - }, - "computed": false + } } ], "extra": { diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/arrow-like-in-conditional-1/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/arrow-like-in-conditional-1/output.json index 06f67e0aab..8f85b830a3 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/arrow-like-in-conditional-1/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/arrow-like-in-conditional-1/output.json @@ -10,13 +10,6 @@ { "type": "ExpressionStatement", "start":47,"end":76,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " https://github.com/babel/babel/issues/11038", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} - } - ], "expression": { "type": "ConditionalExpression", "start":47,"end":75,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, @@ -45,10 +38,6 @@ "body": { "type": "AssignmentExpression", "start":57,"end":65,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":18}}, - "extra": { - "parenthesized": true, - "parenStart": 56 - }, "operator": "+=", "left": { "type": "Identifier", @@ -59,6 +48,10 @@ "type": "Identifier", "start":64,"end":65,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"v"}, "name": "v" + }, + "extra": { + "parenthesized": true, + "parenStart": 56 } } }, @@ -85,7 +78,14 @@ "value": 0 } } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " https://github.com/babel/babel/issues/11038", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/destructuring-with-annotation-newline/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/destructuring-with-annotation-newline/output.json index de2d4df6cc..d455298f64 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/destructuring-with-annotation-newline/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/destructuring-with-annotation-newline/output.json @@ -37,10 +37,7 @@ { "type": "ObjectProperty", "start":6,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, - "extra": { - "shorthand": true - }, - "method":false, + "method": false, "key": { "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, @@ -52,14 +49,14 @@ "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" + }, + "extra": { + "shorthand": true } }, { "type": "ObjectProperty", "start":9,"end":10,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, - "extra": { - "shorthand": true - }, "method": false, "key": { "type": "Identifier", @@ -72,6 +69,9 @@ "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"b"}, "name": "b" + }, + "extra": { + "shorthand": true } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx-babel-7/output.json index 63b920fbf4..2d19c9f092 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx-babel-7/output.json @@ -10,13 +10,6 @@ { "type": "ExpressionStatement", "start":61,"end":79,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Same as `generic`. Verify that JSX doesn't change things.", - "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}} - } - ], "expression": { "type": "ArrowFunctionExpression", "start":61,"end":78,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, @@ -72,7 +65,14 @@ } ] } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Same as `generic`. Verify that JSX doesn't change things.", + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx/output.json index 1756e5e224..465016d10d 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx/output.json @@ -10,13 +10,6 @@ { "type": "ExpressionStatement", "start":61,"end":79,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Same as `generic`. Verify that JSX doesn't change things.", - "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}} - } - ], "expression": { "type": "ArrowFunctionExpression", "start":61,"end":78,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, @@ -76,7 +69,14 @@ } ] } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Same as `generic`. Verify that JSX doesn't change things.", + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/output.json index 6fe5b08735..493dae7321 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-as-identifier/output.json @@ -10,6 +10,7 @@ { "type": "TSDeclareFunction", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, + "declare": true, "id": { "type": "Identifier", "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31},"identifierName":"assertIsString"}, @@ -44,8 +45,7 @@ "name": "asserts" } } - }, - "declare": true + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json index 8a552c9028..41c804823e 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json @@ -125,4 +125,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration-with-line-break/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration-with-line-break/output.json index c86ab9a36f..fd3f2e91a6 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration-with-line-break/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration-with-line-break/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "id": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "assert" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"assert"}, "name": "assert" }, "generator": false, @@ -65,95 +20,27 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "condition" - }, + "start":16,"end":30,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":30},"identifierName":"condition"}, "name": "condition", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":25,"end":30,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":30}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 31, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":31,"end":50,"loc":{"start":{"line":1,"column":31},"end":{"line":2,"column":17}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 33, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":33,"end":50,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "parameterName": { "type": "Identifier", - "start": 41, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "condition" - }, + "start":41,"end":50,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17},"identifierName":"condition"}, "name": "condition" }, "asserts": true, @@ -162,18 +49,7 @@ }, "body": { "type": "BlockStatement", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":51,"end":53,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } @@ -181,4 +57,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/cast/as-const/output.json b/packages/babel-parser/test/fixtures/typescript/cast/as-const/output.json index b0aceac139..96cd8c7e55 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/as-const/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/as-const/output.json @@ -1208,12 +1208,12 @@ "type": "ThisExpression", "start":786,"end":790,"loc":{"start":{"line":26,"column":26},"end":{"line":26,"column":30}} }, + "computed": false, "property": { "type": "Identifier", "start":791,"end":792,"loc":{"start":{"line":26,"column":31},"end":{"line":26,"column":32},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "right": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/typescript/cast/as/output.json b/packages/babel-parser/test/fixtures/typescript/cast/as/output.json index 8cac92ca57..72247e0bc9 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/as/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/as/output.json @@ -89,19 +89,19 @@ "name": "y" } }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " (x < y) as boolean;", - "start":26,"end":48,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":40}} - } - ], "trailingComments": [ { "type": "CommentLine", "value": " (x as boolean) <= y;", "start":68,"end":91,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":42}} } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " (x < y) as boolean;", + "start":26,"end":48,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":40}} + } ] }, { @@ -134,19 +134,19 @@ } } }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " (x as boolean) <= y;", - "start":68,"end":91,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":42}} - } - ], "trailingComments": [ { "type": "CommentLine", "value": " x === (1 as number);", "start":111,"end":134,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":42}} } + ], + "leadingComments": [ + { + "type": "CommentLine", + "value": " (x as boolean) <= y;", + "start":68,"end":91,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":42}} + } ] }, { diff --git a/packages/babel-parser/test/fixtures/typescript/cast/assert-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/assert-and-assign/output.json index 4431d1e380..b0cd2fe5f4 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/assert-and-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/assert-and-assign/output.json @@ -17,10 +17,6 @@ "left": { "type": "TSAsExpression", "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "expression": { "type": "Identifier", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, @@ -29,6 +25,10 @@ "typeAnnotation": { "type": "TSNumberKeyword", "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}} + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "right": { @@ -48,10 +48,6 @@ "expression": { "type": "AssignmentExpression", "start":21,"end":49,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":29}}, - "extra": { - "parenthesized": true, - "parenStart": 20 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -74,10 +70,6 @@ "left": { "type": "TSAsExpression", "start":27,"end":35,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":15}}, - "extra": { - "parenthesized": true, - "parenStart": 26 - }, "expression": { "type": "Identifier", "start":27,"end":28,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"b"}, @@ -86,6 +78,10 @@ "typeAnnotation": { "type": "TSAnyKeyword", "start":32,"end":35,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15}} + }, + "extra": { + "parenthesized": true, + "parenStart": 26 } }, "right": { @@ -105,6 +101,10 @@ "type": "Identifier", "start":48,"end":49,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":29},"identifierName":"x"}, "name": "x" + }, + "extra": { + "parenthesized": true, + "parenStart": 20 } } } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/invalid/output.json b/packages/babel-parser/test/fixtures/typescript/cast/invalid/output.json index 331f76ac53..b4226d70c0 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/invalid/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/invalid/output.json @@ -21,10 +21,6 @@ "expression": { "type": "TSTypeCastExpression", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "expression": { "type": "Identifier", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, @@ -42,6 +38,10 @@ "name": "b" } } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } }, @@ -51,10 +51,6 @@ "expression": { "type": "SequenceExpression", "start":8,"end":15,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":8}}, - "extra": { - "parenthesized": true, - "parenStart": 7 - }, "expressions": [ { "type": "TSTypeCastExpression", @@ -100,7 +96,11 @@ } } } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 7 + } } }, { diff --git a/packages/babel-parser/test/fixtures/typescript/cast/multiple-assert-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/multiple-assert-and-assign/output.json index 6741a2fd15..cbd35d32f7 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/multiple-assert-and-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/multiple-assert-and-assign/output.json @@ -17,10 +17,6 @@ "left": { "type": "TSAsExpression", "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "expression": { "type": "TSAsExpression", "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, @@ -37,6 +33,10 @@ "typeAnnotation": { "type": "TSAnyKeyword", "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}} + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/typescript/cast/need-parentheses/output.json b/packages/babel-parser/test/fixtures/typescript/cast/need-parentheses/output.json index 06c4c0109b..3fef62972d 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/need-parentheses/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/need-parentheses/output.json @@ -35,12 +35,12 @@ "parenStart": 0 } }, + "computed": false, "property": { "type": "Identifier", "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"y"}, "name": "y" - }, - "computed": false + } } }, { @@ -71,12 +71,12 @@ "parenStart": 11 } }, + "computed": false, "property": { "type": "Identifier", "start":20,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"y"}, "name": "y" - }, - "computed": false + } } }, { @@ -94,12 +94,12 @@ "name": "x" } }, + "computed": false, "property": { "type": "Identifier", "start":26,"end":27,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"y"}, "name": "y" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-then-property-access/output.json b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-then-property-access/output.json index 4f00ec5ea1..762b046da7 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-then-property-access/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-then-property-access/output.json @@ -22,12 +22,12 @@ "name": "x" } }, + "computed": false, "property": { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"y"}, "name": "y" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-and-assign/output.json index 6e656ebb14..5b7a8bb9fd 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-and-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-and-assign/output.json @@ -17,10 +17,6 @@ "left": { "type": "TSTypeAssertion", "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "typeAnnotation": { "type": "TSNumberKeyword", "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}} @@ -29,6 +25,10 @@ "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/output.json index ae1af02f4f..c616692021 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/output.json @@ -48,10 +48,6 @@ "expression": { "type": "AssignmentExpression", "start":18,"end":44,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":27}}, - "extra": { - "parenthesized": true, - "parenStart": 17 - }, "operator": "=", "left": { "type": "ObjectPattern", @@ -101,6 +97,10 @@ "type": "Identifier", "start":43,"end":44,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":27},"identifierName":"x"}, "name": "x" + }, + "extra": { + "parenthesized": true, + "parenStart": 17 } } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json index 35a14ac6e2..832fe4111a 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json @@ -43,13 +43,6 @@ { "type": "ExportNamedDeclaration", "start":50,"end":77,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " `export abstract class {}` is not valid TypeScript.", - "start":78,"end":132,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":54}} - } - ], "exportKind": "value", "specifiers": [], "source": null, @@ -68,18 +61,18 @@ "start":75,"end":77,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":27}}, "body": [] } - } - }, - { - "type": "ExportDefaultDeclaration", - "start":133,"end":166,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":33}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " `export abstract class {}` is not valid TypeScript.", "start":78,"end":132,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":54}} } - ], + ] + }, + { + "type": "ExportDefaultDeclaration", + "start":133,"end":166,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":33}}, "exportKind": "value", "declaration": { "type": "ClassDeclaration", @@ -92,18 +85,18 @@ "start":163,"end":166,"loc":{"start":{"line":5,"column":30},"end":{"line":5,"column":33}}, "body": [] } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " `export abstract class {}` is not valid TypeScript.", + "start":78,"end":132,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":54}} + } + ] }, { "type": "ExportDefaultDeclaration", "start":167,"end":203,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}}, - "trailingComments": [ - { - "type": "CommentLine", - "value": " `abstract class` is not valid as an expression.", - "start":204,"end":254,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":50}} - } - ], "exportKind": "value", "declaration": { "type": "ClassDeclaration", @@ -120,18 +113,18 @@ "start":200,"end":203,"loc":{"start":{"line":6,"column":33},"end":{"line":6,"column":36}}, "body": [] } - } - }, - { - "type": "ExportDefaultDeclaration", - "start":255,"end":313,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":58}}, - "leadingComments": [ + }, + "trailingComments": [ { "type": "CommentLine", "value": " `abstract class` is not valid as an expression.", "start":204,"end":254,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":50}} } - ], + ] + }, + { + "type": "ExportDefaultDeclaration", + "start":255,"end":313,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":58}}, "exportKind": "value", "declaration": { "type": "ClassDeclaration", @@ -174,7 +167,14 @@ } ] } - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " `abstract class` is not valid as an expression.", + "start":204,"end":254,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":50}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field-modifiers/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-field-modifiers/output.json index f5caff15c0..73bfd3e265 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-field-modifiers/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field-modifiers/output.json @@ -36,8 +36,8 @@ { "type": "ClassProperty", "start":34,"end":62,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":30}}, - "declare": true, "static": true, + "declare": true, "key": { "type": "Identifier", "start":49,"end":53,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":21},"identifierName":"foo0"}, @@ -114,8 +114,8 @@ "type": "ClassProperty", "start":173,"end":200,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":29}}, "accessibility": "public", - "declare": true, "static": true, + "declare": true, "key": { "type": "Identifier", "start":195,"end":199,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":28},"identifierName":"foo5"}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/expression-generic-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/class/expression-generic-babel-7/output.json index 474f9a0a9c..1947c1767d 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/expression-generic-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/expression-generic-babel-7/output.json @@ -13,10 +13,6 @@ "expression": { "type": "ClassExpression", "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "typeParameters": { "type": "TSTypeParameterDeclaration", @@ -34,6 +30,10 @@ "type": "ClassBody", "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } }, @@ -43,10 +43,6 @@ "expression": { "type": "ClassExpression", "start":16,"end":29,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 15 - }, "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"C"}, @@ -68,6 +64,10 @@ "type": "ClassBody", "start":27,"end":29,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 15 } } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/expression-generic/output.json b/packages/babel-parser/test/fixtures/typescript/class/expression-generic/output.json index fd30356691..3e6723380f 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/expression-generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/expression-generic/output.json @@ -13,10 +13,6 @@ "expression": { "type": "ClassExpression", "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, - "extra": { - "parenthesized": true, - "parenStart": 0 - }, "id": null, "typeParameters": { "type": "TSTypeParameterDeclaration", @@ -38,6 +34,10 @@ "type": "ClassBody", "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } }, @@ -47,10 +47,6 @@ "expression": { "type": "ClassExpression", "start":16,"end":29,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":14}}, - "extra": { - "parenthesized": true, - "parenStart": 15 - }, "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"C"}, @@ -76,6 +72,10 @@ "type": "ClassBody", "start":27,"end":29,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 15 } } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/index-signature/output.json b/packages/babel-parser/test/fixtures/typescript/class/index-signature/output.json index c27ce068c7..8b51137c10 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/index-signature/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/index-signature/output.json @@ -106,8 +106,8 @@ { "type": "TSIndexSignature", "start":96,"end":129,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":37}}, - "readonly": true, "static": true, + "readonly": true, "parameters": [ { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/output.json index 6619ed4663..3f684d7c37 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names-babel-7/output.json @@ -48,14 +48,14 @@ "type": "TSDeclareMethod", "start":34,"end":56,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":26}}, "accessibility": "public", - "kind": "method", - "computed": false, + "static": false, "key": { "type": "Identifier", "start":41,"end":47,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17},"identifierName":"static"}, "name": "static" }, - "static": false, + "computed": false, + "kind": "method", "id": null, "generator": false, "async": false, diff --git a/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/output.json b/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/output.json index 2945b53aa0..396726e7a1 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/members-with-modifier-names/output.json @@ -48,14 +48,14 @@ "type": "TSDeclareMethod", "start":34,"end":56,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":26}}, "accessibility": "public", - "kind": "method", - "computed": false, + "static": false, "key": { "type": "Identifier", "start":41,"end":47,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17},"identifierName":"static"}, "name": "static" }, - "static": false, + "computed": false, + "kind": "method", "id": null, "generator": false, "async": false, diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-computed/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-computed/output.json index 48a27c3f99..a03715c5bd 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-computed/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-computed/output.json @@ -33,12 +33,12 @@ "start":15,"end":21,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":22,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "kind": "method", "id": null, @@ -67,12 +67,12 @@ "start":46,"end":52,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":53,"end":61,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "optional": true, "kind": "method", diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-modifier-name-with-type-parameters-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-modifier-name-with-type-parameters-babel-7/output.json index c242a1291f..8e9df30e10 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-modifier-name-with-type-parameters-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-modifier-name-with-type-parameters-babel-7/output.json @@ -122,14 +122,14 @@ { "type": "ClassMethod", "start":68,"end":82,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":16}}, - "kind": "method", - "computed": false, + "static": false, "key": { "type": "Identifier", "start":68,"end":74,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":8},"identifierName":"static"}, "name": "static" }, - "static": false, + "computed": false, + "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", "start":74,"end":77,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":11}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-modifier-name-with-type-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-modifier-name-with-type-parameters/output.json index f3dd150124..8aa1a26eb3 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-modifier-name-with-type-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-modifier-name-with-type-parameters/output.json @@ -134,14 +134,14 @@ { "type": "ClassMethod", "start":68,"end":82,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":16}}, - "kind": "method", - "computed": false, + "static": false, "key": { "type": "Identifier", "start":68,"end":74,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":8},"identifierName":"static"}, "name": "static" }, - "static": false, + "computed": false, + "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", "start":74,"end":77,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":11}}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-properties/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-properties/output.json index 7f16ab4af1..a9deaa06b5 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-properties/output.json @@ -151,8 +151,8 @@ { "type": "ClassProperty", "start":198,"end":217,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":23}}, - "readonly": true, "static": true, + "readonly": true, "key": { "type": "Identifier", "start":214,"end":216,"loc":{"start":{"line":13,"column":20},"end":{"line":13,"column":22},"identifierName":"sr"}, @@ -236,8 +236,8 @@ "type": "ClassProperty", "start":366,"end":394,"loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":32}}, "accessibility": "public", - "readonly": true, "static": true, + "readonly": true, "key": { "type": "Identifier", "start":389,"end":393,"loc":{"start":{"line":20,"column":27},"end":{"line":20,"column":31},"identifierName":"pusr"}, diff --git a/packages/babel-parser/test/fixtures/typescript/class/property-computed/output.json b/packages/babel-parser/test/fixtures/typescript/class/property-computed/output.json index e44bdb7e01..fe5ce9a7a7 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/property-computed/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/property-computed/output.json @@ -33,12 +33,12 @@ "start":15,"end":21,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":22,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "typeAnnotation": { "type": "TSTypeAnnotation", @@ -63,12 +63,12 @@ "start":46,"end":52,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":53,"end":61,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "optional": true, "typeAnnotation": { diff --git a/packages/babel-parser/test/fixtures/typescript/exponentiation/valid-parenthesized-await-non-null-before-exponential/output.json b/packages/babel-parser/test/fixtures/typescript/exponentiation/valid-parenthesized-await-non-null-before-exponential/output.json index 0c36f6fbe5..e9a2aeb008 100644 --- a/packages/babel-parser/test/fixtures/typescript/exponentiation/valid-parenthesized-await-non-null-before-exponential/output.json +++ b/packages/babel-parser/test/fixtures/typescript/exponentiation/valid-parenthesized-await-non-null-before-exponential/output.json @@ -29,10 +29,6 @@ "left": { "type": "AwaitExpression", "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, - "extra": { - "parenthesized": true, - "parenStart": 13 - }, "argument": { "type": "TSNonNullExpression", "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, @@ -41,6 +37,10 @@ "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"a"}, "name": "a" } + }, + "extra": { + "parenthesized": true, + "parenStart": 13 } }, "operator": "**", diff --git a/packages/babel-parser/test/fixtures/typescript/export/internal-comments/output.json b/packages/babel-parser/test/fixtures/typescript/export/internal-comments/output.json index 28d3759266..14f5660ae2 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/internal-comments/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/internal-comments/output.json @@ -10,20 +10,96 @@ { "type": "ExportNamedDeclaration", "start":6,"end":93,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":93}}, - "leadingComments": [ + "exportKind": "value", + "specifiers": [ { - "type": "CommentBlock", - "value": "1", - "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "1", - "start":94,"end":99,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}} + "type": "ExportSpecifier", + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, + "local": { + "type": "Identifier", + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"A"}, + "name": "A" + }, + "exported": { + "type": "Identifier", + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"A"}, + "name": "A" + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "4", + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "3", + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}} + } + ] + }, + { + "type": "ExportSpecifier", + "start":42,"end":60,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":60}}, + "local": { + "type": "Identifier", + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"B"}, + "name": "B", + "trailingComments": [ + { + "type": "CommentBlock", + "value": "6", + "start":44,"end":49,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":49}} + } + ] + }, + "exported": { + "type": "Identifier", + "start":59,"end":60,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":60},"identifierName":"C"}, + "name": "C", + "leadingComments": [ + { + "type": "CommentBlock", + "value": "7", + "start":53,"end":58,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":58}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "8", + "start":61,"end":66,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":66}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "5", + "start":36,"end":41,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":41}} + } + ] } ], + "source": { + "type": "StringLiteral", + "start":87,"end":92,"loc":{"start":{"line":1,"column":87},"end":{"line":1,"column":92}}, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo", + "leadingComments": [ + { + "type": "CommentBlock", + "value": "10", + "start":80,"end":86,"loc":{"start":{"line":1,"column":80},"end":{"line":1,"column":86}} + } + ] + }, + "declaration": null, "innerComments": [ { "type": "CommentBlock", @@ -36,107 +112,41 @@ "start":69,"end":74,"loc":{"start":{"line":1,"column":69},"end":{"line":1,"column":74}} } ], - "exportKind": "value", - "specifiers": [ - { - "type": "ExportSpecifier", - "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "3", - "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "4", - "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}} - } - ], - "local": { - "type": "Identifier", - "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"A"}, - "name": "A" - }, - "exported": { - "type": "Identifier", - "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"A"}, - "name": "A" - } - }, - { - "type": "ExportSpecifier", - "start":42,"end":60,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":60}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "5", - "start":36,"end":41,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":41}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "8", - "start":61,"end":66,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":66}} - } - ], - "local": { - "type": "Identifier", - "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"B"}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": "6", - "start":44,"end":49,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":49}} - } - ], - "name": "B" - }, - "exported": { - "type": "Identifier", - "start":59,"end":60,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":60},"identifierName":"C"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "7", - "start":53,"end":58,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":58}} - } - ], - "name": "C" - } - } - ], - "source": { - "type": "StringLiteral", - "start":87,"end":92,"loc":{"start":{"line":1,"column":87},"end":{"line":1,"column":92}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "10", - "start":80,"end":86,"loc":{"start":{"line":1,"column":80},"end":{"line":1,"column":86}} - } - ], - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - }, - "declaration": null - }, - { - "type": "ExportAllDeclaration", - "start":100,"end":137,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":43}}, - "leadingComments": [ + "trailingComments": [ { "type": "CommentBlock", "value": "1", "start":94,"end":99,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}} } ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "1", + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}} + } + ] + }, + { + "type": "ExportAllDeclaration", + "start":100,"end":137,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":43}}, + "exportKind": "value", + "source": { + "type": "StringLiteral", + "start":132,"end":137,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":43}}, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo", + "leadingComments": [ + { + "type": "CommentBlock", + "value": "4", + "start":126,"end":131,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":37}} + } + ] + }, "innerComments": [ { "type": "CommentBlock", @@ -149,23 +159,13 @@ "start":115,"end":120,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":26}} } ], - "exportKind": "value", - "source": { - "type": "StringLiteral", - "start":132,"end":137,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":43}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "4", - "start":126,"end":131,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":37}} - } - ], - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } + "leadingComments": [ + { + "type": "CommentBlock", + "value": "1", + "start":94,"end":99,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}} + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/function/predicate-types/output.json b/packages/babel-parser/test/fixtures/typescript/function/predicate-types/output.json index fe92c89b9a..b63df7f1b8 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/predicate-types/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/predicate-types/output.json @@ -67,10 +67,6 @@ "expression": { "type": "FunctionExpression", "start":37,"end":70,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":34}}, - "extra": { - "parenthesized": true, - "parenStart": 36 - }, "id": null, "generator": false, "async": false, @@ -116,6 +112,10 @@ "start":68,"end":70,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":34}}, "body": [], "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 36 } } } diff --git a/packages/babel-parser/test/fixtures/typescript/import/internal-comments/output.json b/packages/babel-parser/test/fixtures/typescript/import/internal-comments/output.json index cdec7ba325..53e1eadab4 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/internal-comments/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/internal-comments/output.json @@ -10,20 +10,118 @@ { "type": "ImportDeclaration", "start":6,"end":110,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":110}}, - "leadingComments": [ + "importKind": "value", + "specifiers": [ { - "type": "CommentBlock", - "value": "1", - "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "1", - "start":111,"end":116,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}} + "type": "ImportDefaultSpecifier", + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, + "local": { + "type": "Identifier", + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"D"}, + "name": "D" + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "3", + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "2", + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}} + } + ] + }, + { + "type": "ImportSpecifier", + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}}, + "imported": { + "type": "Identifier", + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"A"}, + "name": "A" + }, + "local": { + "type": "Identifier", + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"A"}, + "name": "A" + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "6", + "start":44,"end":49,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":49}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "5", + "start":36,"end":41,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":41}} + } + ] + }, + { + "type": "ImportSpecifier", + "start":57,"end":75,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":75}}, + "imported": { + "type": "Identifier", + "start":57,"end":58,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":58},"identifierName":"B"}, + "name": "B", + "trailingComments": [ + { + "type": "CommentBlock", + "value": "8", + "start":59,"end":64,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":64}} + } + ] + }, + "local": { + "type": "Identifier", + "start":74,"end":75,"loc":{"start":{"line":1,"column":74},"end":{"line":1,"column":75},"identifierName":"C"}, + "name": "C", + "leadingComments": [ + { + "type": "CommentBlock", + "value": "9", + "start":68,"end":73,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":73}} + } + ] + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "10", + "start":76,"end":82,"loc":{"start":{"line":1,"column":76},"end":{"line":1,"column":82}} + } + ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "7", + "start":51,"end":56,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":56}} + } + ] } ], + "source": { + "type": "StringLiteral", + "start":104,"end":109,"loc":{"start":{"line":1,"column":104},"end":{"line":1,"column":109}}, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo", + "leadingComments": [ + { + "type": "CommentBlock", + "value": "12", + "start":97,"end":103,"loc":{"start":{"line":1,"column":97},"end":{"line":1,"column":103}} + } + ] + }, "innerComments": [ { "type": "CommentBlock", @@ -36,139 +134,46 @@ "start":85,"end":91,"loc":{"start":{"line":1,"column":85},"end":{"line":1,"column":91}} } ], - "importKind": "value", - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "2", - "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "3", - "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}} - } - ], - "local": { - "type": "Identifier", - "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"D"}, - "name": "D" - } - }, - { - "type": "ImportSpecifier", - "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "5", - "start":36,"end":41,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":41}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "6", - "start":44,"end":49,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":49}} - } - ], - "imported": { - "type": "Identifier", - "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"A"}, - "name": "A" - }, - "local": { - "type": "Identifier", - "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"A"}, - "name": "A" - } - }, - { - "type": "ImportSpecifier", - "start":57,"end":75,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":75}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "7", - "start":51,"end":56,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":56}} - } - ], - "trailingComments": [ - { - "type": "CommentBlock", - "value": "10", - "start":76,"end":82,"loc":{"start":{"line":1,"column":76},"end":{"line":1,"column":82}} - } - ], - "imported": { - "type": "Identifier", - "start":57,"end":58,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":58},"identifierName":"B"}, - "trailingComments": [ - { - "type": "CommentBlock", - "value": "8", - "start":59,"end":64,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":64}} - } - ], - "name": "B" - }, - "local": { - "type": "Identifier", - "start":74,"end":75,"loc":{"start":{"line":1,"column":74},"end":{"line":1,"column":75},"identifierName":"C"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "9", - "start":68,"end":73,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":73}} - } - ], - "name": "C" - } - } - ], - "source": { - "type": "StringLiteral", - "start":104,"end":109,"loc":{"start":{"line":1,"column":104},"end":{"line":1,"column":109}}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "12", - "start":97,"end":103,"loc":{"start":{"line":1,"column":97},"end":{"line":1,"column":103}} - } - ], - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } - }, - { - "type": "ImportDeclaration", - "start":117,"end":174,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":63}}, - "leadingComments": [ + "trailingComments": [ { "type": "CommentBlock", "value": "1", "start":111,"end":116,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}} } ], + "leadingComments": [ + { + "type": "CommentBlock", + "value": "1", + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}} + } + ] + }, + { + "type": "ImportDeclaration", + "start":117,"end":174,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":63}}, "importKind": "value", "specifiers": [ { "type": "ImportNamespaceSpecifier", "start":130,"end":150,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":39}}, - "leadingComments": [ + "local": { + "type": "Identifier", + "start":147,"end":150,"loc":{"start":{"line":2,"column":36},"end":{"line":2,"column":39},"identifierName":"foo"}, + "name": "foo", + "leadingComments": [ + { + "type": "CommentBlock", + "value": "4", + "start":141,"end":146,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":35}} + } + ] + }, + "innerComments": [ { "type": "CommentBlock", - "value": "2", - "start":124,"end":129,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18}} + "value": "3", + "start":132,"end":137,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":26}} } ], "trailingComments": [ @@ -178,43 +183,38 @@ "start":151,"end":156,"loc":{"start":{"line":2,"column":40},"end":{"line":2,"column":45}} } ], - "innerComments": [ + "leadingComments": [ { "type": "CommentBlock", - "value": "3", - "start":132,"end":137,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":26}} + "value": "2", + "start":124,"end":129,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18}} } - ], - "local": { - "type": "Identifier", - "start":147,"end":150,"loc":{"start":{"line":2,"column":36},"end":{"line":2,"column":39},"identifierName":"foo"}, - "leadingComments": [ - { - "type": "CommentBlock", - "value": "4", - "start":141,"end":146,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":35}} - } - ], - "name": "foo" - } + ] } ], "source": { "type": "StringLiteral", "start":168,"end":173,"loc":{"start":{"line":2,"column":57},"end":{"line":2,"column":62}}, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo", "leadingComments": [ { "type": "CommentBlock", "value": "6", "start":162,"end":167,"loc":{"start":{"line":2,"column":51},"end":{"line":2,"column":56}} } - ], - "extra": { - "rawValue": "foo", - "raw": "\"foo\"" - }, - "value": "foo" - } + ] + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "1", + "start":111,"end":116,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}} + } + ] } ], "directives": [] @@ -311,4 +311,4 @@ "start":162,"end":167,"loc":{"start":{"line":2,"column":51},"end":{"line":2,"column":56}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/output.json index 3d08507920..557a0e88ff 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/output.json @@ -25,13 +25,13 @@ { "type": "TSMethodSignature", "start":18,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":25}}, - "kind": "set", "key": { "type": "Identifier", "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, "name": "foo" }, "computed": false, + "kind": "set", "parameters": [ { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set/output.json index fd035cd7cd..1e7ddec8e4 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/get-set/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set/output.json @@ -22,13 +22,13 @@ { "type": "TSMethodSignature", "start":18,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, - "kind": "get", "key": { "type": "Identifier", "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, "name": "foo" }, "computed": false, + "kind": "get", "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", @@ -42,13 +42,13 @@ { "type": "TSMethodSignature", "start":39,"end":50,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, - "kind": "set", "key": { "type": "Identifier", "start":43,"end":46,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"bar"}, "name": "bar" }, "computed": false, + "kind": "set", "parameters": [ { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/modifiers/output.json b/packages/babel-parser/test/fixtures/typescript/interface/modifiers/output.json index 0038b79005..0d9a3c2151 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/modifiers/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/modifiers/output.json @@ -22,13 +22,13 @@ { "type": "TSPropertySignature", "start":18,"end":37,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":23}}, + "readonly": true, "key": { "type": "Identifier", "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"x"}, "name": "x" }, "computed": false, - "readonly": true, "typeAnnotation": { "type": "TSTypeAnnotation", "start":28,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, diff --git a/packages/babel-parser/test/fixtures/typescript/interface/property-computed/output.json b/packages/babel-parser/test/fixtures/typescript/interface/property-computed/output.json index 4d2a307286..61a6a0f52e 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/property-computed/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/property-computed/output.json @@ -31,12 +31,12 @@ "start":19,"end":25,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":26,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "typeAnnotation": { "type": "TSTypeAnnotation", @@ -59,12 +59,12 @@ "start":50,"end":56,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":57,"end":65,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "optional": true, "typeAnnotation": { diff --git a/packages/babel-parser/test/fixtures/typescript/regression/less-than-edge-case/output.json b/packages/babel-parser/test/fixtures/typescript/regression/less-than-edge-case/output.json index ed163c6994..d6cf13b1f3 100644 --- a/packages/babel-parser/test/fixtures/typescript/regression/less-than-edge-case/output.json +++ b/packages/babel-parser/test/fixtures/typescript/regression/less-than-edge-case/output.json @@ -67,12 +67,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38},"identifierName":"bar"}, "name": "bar" - }, - "computed": false + } } }, "update": { diff --git a/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/output.json b/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/output.json index 9369b9ba7d..3c5b73f392 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/output.json @@ -26,6 +26,7 @@ { "type": "TSDeclareFunction", "start":20,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, + "declare": true, "id": { "type": "Identifier", "start":37,"end":38,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"C"}, @@ -41,8 +42,7 @@ "type": "TSVoidKeyword", "start":42,"end":46,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":26}} } - }, - "declare": true + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-declare-function-after/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-declare-function-after/output.json index 72f0f6635a..f867f1ebfb 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-declare-function-after/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-declare-function-after/output.json @@ -10,6 +10,7 @@ { "type": "TSDeclareFunction", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, + "declare": true, "id": { "type": "Identifier", "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, @@ -25,8 +26,7 @@ "type": "TSVoidKeyword", "start":24,"end":28,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":28}} } - }, - "declare": true + } }, { "type": "ExportNamedDeclaration", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-declare-function-before/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-declare-function-before/output.json index 2dc87e91b6..e9ad92c682 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-declare-function-before/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-declare-function-before/output.json @@ -33,6 +33,7 @@ { "type": "TSDeclareFunction", "start":17,"end":46,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":29}}, + "declare": true, "id": { "type": "Identifier", "start":34,"end":37,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":20},"identifierName":"foo"}, @@ -48,8 +49,7 @@ "type": "TSVoidKeyword", "start":41,"end":45,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":28}} } - }, - "declare": true + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/tsx/assignment-in-conditional-expression/output.json b/packages/babel-parser/test/fixtures/typescript/tsx/assignment-in-conditional-expression/output.json index 3780c8015b..7d42eab987 100644 --- a/packages/babel-parser/test/fixtures/typescript/tsx/assignment-in-conditional-expression/output.json +++ b/packages/babel-parser/test/fixtures/typescript/tsx/assignment-in-conditional-expression/output.json @@ -60,10 +60,6 @@ "consequent": { "type": "AssignmentExpression", "start":21,"end":37,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":26}}, - "extra": { - "parenthesized": true, - "parenStart": 20 - }, "operator": "=", "left": { "type": "Identifier", @@ -104,15 +100,15 @@ "value": "123" } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 20 } }, "alternate": { "type": "AssignmentExpression", "start":42,"end":58,"loc":{"start":{"line":3,"column":31},"end":{"line":3,"column":47}}, - "extra": { - "parenthesized": true, - "parenStart": 41 - }, "operator": "=", "left": { "type": "Identifier", @@ -153,6 +149,10 @@ "value": "abc" } ] + }, + "extra": { + "parenthesized": true, + "parenStart": 41 } } } diff --git a/packages/babel-parser/test/fixtures/typescript/tsx/cast-invalid/output.json b/packages/babel-parser/test/fixtures/typescript/tsx/cast-invalid/output.json index 945b8714ec..d3f7b672c9 100644 --- a/packages/babel-parser/test/fixtures/typescript/tsx/cast-invalid/output.json +++ b/packages/babel-parser/test/fixtures/typescript/tsx/cast-invalid/output.json @@ -32,10 +32,6 @@ "argument": { "type": "JSXElement", "start":32,"end":78,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":50}}, - "extra": { - "parenthesized": true, - "parenStart": 26 - }, "openingElement": { "type": "JSXOpeningElement", "start":32,"end":78,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":50}}, @@ -100,10 +96,6 @@ "expression": { "type": "TSTypeCastExpression", "start":69,"end":73,"loc":{"start":{"line":3,"column":41},"end":{"line":3,"column":45}}, - "extra": { - "parenthesized": true, - "parenStart": 68 - }, "expression": { "type": "Identifier", "start":69,"end":70,"loc":{"start":{"line":3,"column":41},"end":{"line":3,"column":42},"identifierName":"a"}, @@ -121,6 +113,10 @@ "name": "b" } } + }, + "extra": { + "parenthesized": true, + "parenStart": 68 } } } @@ -129,7 +125,11 @@ "selfClosing": true }, "closingElement": null, - "children": [] + "children": [], + "extra": { + "parenthesized": true, + "parenStart": 26 + } } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/type-alias/generic/output.json b/packages/babel-parser/test/fixtures/typescript/type-alias/generic/output.json index e206b9b5ac..41d74e3392 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-alias/generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-alias/generic/output.json @@ -43,4 +43,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/object-shorthand-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/types/object-shorthand-babel-7/output.json index cf6101ace1..5b8fb1442f 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/object-shorthand-babel-7/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/object-shorthand-babel-7/output.json @@ -95,15 +95,15 @@ "body": { "type": "BlockStatement", "start":58,"end":84,"loc":{"start":{"line":2,"column":42},"end":{"line":4,"column":3}}, + "body": [], + "directives": [], "innerComments": [ { "type": "CommentLine", "value": " actually put.", "start":64,"end":80,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}} } - ], - "body": [], - "directives": [] + ] } } ] diff --git a/packages/babel-parser/test/fixtures/typescript/types/object-shorthand/output.json b/packages/babel-parser/test/fixtures/typescript/types/object-shorthand/output.json index 843282ace9..55a7051a06 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/object-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/object-shorthand/output.json @@ -99,15 +99,15 @@ "body": { "type": "BlockStatement", "start":58,"end":84,"loc":{"start":{"line":2,"column":42},"end":{"line":4,"column":3}}, + "body": [], + "directives": [], "innerComments": [ { "type": "CommentLine", "value": " actually put.", "start":64,"end":80,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}} } - ], - "body": [], - "directives": [] + ] } } ] diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional/output.json index 31a7bf7f95..79a7f41035 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional/output.json @@ -43,10 +43,6 @@ "typeAnnotation": { "type": "TSUnionType", "start":26,"end":41,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":41}}, - "extra": { - "parenthesized": true, - "parenStart": 25 - }, "types": [ { "type": "TSStringKeyword", @@ -56,7 +52,11 @@ "type": "TSNumberKeyword", "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}} } - ] + ], + "extra": { + "parenthesized": true, + "parenStart": 25 + } } } ] @@ -71,4 +71,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/output.json b/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/output.json index 1709b69d53..1f3d7b8a71 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/output.json @@ -28,13 +28,13 @@ { "type": "TSMethodSignature", "start":13,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, - "kind": "get", "key": { "type": "Identifier", "start":17,"end":20,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, "name": "foo" }, "computed": false, + "kind": "get", "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", @@ -48,13 +48,13 @@ { "type": "TSMethodSignature", "start":34,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, - "kind": "set", "key": { "type": "Identifier", "start":38,"end":41,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"bar"}, "name": "bar" }, "computed": false, + "kind": "set", "parameters": [ { "type": "Identifier",